mirror of
https://github.com/run-llama/create-llama.git
synced 2026-07-02 19:14:28 -04:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a21dc86eaa | |||
| 83681febd4 | |||
| 8ebd1651b3 | |||
| 4cbe8c6641 | |||
| 90e38358b3 |
+7
-1
@@ -215,9 +215,10 @@ export const installPythonTemplate = async ({
|
||||
},
|
||||
});
|
||||
|
||||
const compPath = path.join(templatesDir, "components");
|
||||
|
||||
if (dataSources.length > 0) {
|
||||
const enginePath = path.join(root, "app", "engine");
|
||||
const compPath = path.join(templatesDir, "components");
|
||||
|
||||
const vectorDbDirName = vectorDb ?? "none";
|
||||
const VectorDBPath = path.join(
|
||||
@@ -304,4 +305,9 @@ export const installPythonTemplate = async ({
|
||||
if (postInstallAction === "runApp" || postInstallAction === "dependencies") {
|
||||
installPythonDependencies();
|
||||
}
|
||||
|
||||
// Copy deployment files for python
|
||||
await copy("**", root, {
|
||||
cwd: path.join(compPath, "deployments", "python"),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -303,4 +303,9 @@ export const installTSTemplate = async ({
|
||||
if (postInstallAction === "runApp" || postInstallAction === "dependencies") {
|
||||
await installTSDependencies(packageJson, packageManager, isOnline);
|
||||
}
|
||||
|
||||
// Copy deployment files for typescript
|
||||
await copy("**", root, {
|
||||
cwd: path.join(compPath, "deployments", "typescript"),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM python:3.11 as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONPATH=/app
|
||||
|
||||
# Install Poetry
|
||||
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
|
||||
cd /usr/local/bin && \
|
||||
ln -s /opt/poetry/bin/poetry && \
|
||||
poetry config virtualenvs.create false
|
||||
|
||||
# Install dependencies
|
||||
COPY ./pyproject.toml ./poetry.lock* /app/
|
||||
RUN poetry install --no-root --no-cache --only main
|
||||
|
||||
# ====================================
|
||||
FROM build as release
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
@@ -0,0 +1,19 @@
|
||||
FROM node:20-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json pnpm-lock.yaml* /app/
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install
|
||||
|
||||
# Build the application
|
||||
COPY . .
|
||||
RUN pnpm run build
|
||||
|
||||
# ====================================
|
||||
FROM build as release
|
||||
|
||||
RUN chmod +x start.sh
|
||||
|
||||
CMD ["/bin/sh", "start.sh"]
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$ENVIRONMENT" = "dev" ]; then
|
||||
echo "Running Development mode"
|
||||
pnpm dev
|
||||
else
|
||||
echo "Running Production mode"
|
||||
pnpm build
|
||||
pnpm start
|
||||
fi
|
||||
@@ -51,6 +51,20 @@ The API allows CORS for all origins to simplify development. You can change this
|
||||
ENVIRONMENT=prod python main.py
|
||||
```
|
||||
|
||||
## Using docker
|
||||
|
||||
1. Build an image for FastAPI app:
|
||||
|
||||
```
|
||||
docker build -t <your_backend_image_name> .
|
||||
```
|
||||
|
||||
2. Run a container:
|
||||
|
||||
```
|
||||
docker run --rm -v $(pwd)/.env:/app/.env -p 8000:8000 <your_backend_image_name>
|
||||
```
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about LlamaIndex, take a look at the following resources:
|
||||
|
||||
@@ -60,6 +60,20 @@ NODE_ENV=production npm run start
|
||||
|
||||
> Note that the `NODE_ENV` environment variable is set to `production`. This disables CORS for all origins.
|
||||
|
||||
## Using docker
|
||||
|
||||
1. Build an image for Express app:
|
||||
|
||||
```
|
||||
docker build -t <your_backend_image_name> .
|
||||
```
|
||||
|
||||
2. Run a container:
|
||||
|
||||
```
|
||||
docker run --rm -v $(pwd)/.env:/app/.env -p 8000:8000 <your_backend_image_name>
|
||||
```
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about LlamaIndex, take a look at the following resources:
|
||||
|
||||
@@ -64,6 +64,20 @@ The API allows CORS for all origins to simplify development. You can change this
|
||||
ENVIRONMENT=prod python main.py
|
||||
```
|
||||
|
||||
## Using docker
|
||||
|
||||
1. Build an image for FastAPI app:
|
||||
|
||||
```
|
||||
docker build -t <your_backend_image_name> .
|
||||
```
|
||||
|
||||
2. Run a container:
|
||||
|
||||
```
|
||||
docker run --rm -v $(pwd)/.env:/app/.env -p 8000:8000 <your_backend_image_name>
|
||||
```
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about LlamaIndex, take a look at the following resources:
|
||||
|
||||
@@ -26,6 +26,20 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
||||
|
||||
## Using docker
|
||||
|
||||
1. Build an image for Next app:
|
||||
|
||||
```
|
||||
docker build -t <your_app_image_name> .
|
||||
```
|
||||
|
||||
2. Run a container:
|
||||
|
||||
```
|
||||
docker run --rm -v $(pwd)/.env:/app/.env -p 3000:3000 <your_app_image_name>
|
||||
```
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about LlamaIndex, take a look at the following resources:
|
||||
|
||||
Reference in New Issue
Block a user