diff --git a/templates/components/deployments/typescript/Dockerfile b/templates/components/deployments/typescript/Dockerfile index b9b28f2d36be9bd50a0ebd91b51bc3e2f5339383..5c738ab4a016cd2fa2732af779191ff4f53d203e 100644 --- a/templates/components/deployments/typescript/Dockerfile +++ b/templates/components/deployments/typescript/Dockerfile @@ -3,8 +3,8 @@ FROM node:20-alpine as build WORKDIR /app # Install dependencies -COPY package.json pnpm-lock.yaml* /app/ -RUN npm install +COPY package.json package-lock.* ./ +RUN npm install # Build the application COPY . . @@ -13,10 +13,4 @@ RUN npm run build # ==================================== FROM build as release -# Copy built output from the previous stage -COPY --from=build /app/.next* ./.next -COPY --from=build /app/public* ./public -COPY --from=build /app/package.json ./package.json -COPY --from=build /app/node_modules ./node_modules - -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/templates/types/streaming/express/README-template.md b/templates/types/streaming/express/README-template.md index 61e164bf1567dae7312e51a79c63c08e942b1f05..8ec0466435359107b3b8d7d8f1a11fab1563f931 100644 --- a/templates/types/streaming/express/README-template.md +++ b/templates/types/streaming/express/README-template.md @@ -62,32 +62,33 @@ NODE_ENV=production npm run start ## Using Docker -1. Build an image for Express app: +1. Build an image for the Express API: ``` docker build -t <your_backend_image_name> . ``` -2. Start the app: +2. Generate embeddings: -- Generate index data: +Parse the data and generate the vector embeddings if the `./data` folder exists - otherwise, skip this step: ``` docker run --rm \ - --v $(pwd)/.env:/app/.env \ # Use ENV variables and configuration from your file-system + -v $(pwd)/.env:/app/.env \ # Use ENV variables and configuration from your file-system -v $(pwd)/config:/app/config \ - -v $(pwd)/cache:/app/cache \ # Use your file system to store gea vector database + -v $(pwd)/data:/app/data \ + -v $(pwd)/cache:/app/cache \ # Use your file system to store the vector database <your_backend_image_name> npm run generate ``` -- Start the API: +3. Start the API: ``` docker run \ -v $(pwd)/.env:/app/.env \ # Use ENV variables and configuration from your file-system -v $(pwd)/config:/app/config \ - -v $(pwd)/cache:/app/cache \ # Use your file system to store gea vector database + -v $(pwd)/cache:/app/cache \ # Use your file system to store the vector database -p 8000:8000 \ <your_backend_image_name> ``` diff --git a/templates/types/streaming/fastapi/README-template.md b/templates/types/streaming/fastapi/README-template.md index 33dbeba6dbf6dc7bca6ae310ef808bf065b240b9..2ea07212556b48fd1ea27a5dfdd0a130f434b09b 100644 --- a/templates/types/streaming/fastapi/README-template.md +++ b/templates/types/streaming/fastapi/README-template.md @@ -64,29 +64,30 @@ The API allows CORS for all origins to simplify development. You can change this ENVIRONMENT=prod python main.py ``` -## Using docker +## Using Docker -1. Build an image for FastAPI app: +1. Build an image for the FastAPI app: ``` docker build -t <your_backend_image_name> . ``` -2. Start the app: +2. Generate embeddings: -- Generate embedding for index data: +Parse the data and generate the vector embeddings if the `./data` folder exists - otherwise, skip this step: ``` docker run \ --rm \ -v $(pwd)/.env:/app/.env \ # Use ENV variables and configuration from your file-system -v $(pwd)/config:/app/config \ - -v $(pwd)/storage:/app/storage \ # Use your file system to store gea vector database + -v $(pwd)/data:/app/data \ # Use your local folder to read the data + -v $(pwd)/storage:/app/storage \ # Use your file system to store the vector database <your_backend_image_name> \ python app/engine/generate.py ``` -- Start the API: +3. Start the API: ``` docker run \ diff --git a/templates/types/streaming/nextjs/README-template.md b/templates/types/streaming/nextjs/README-template.md index c522d311476da625ab91be7f42efb39d57b0c9dc..d2eb1eb850d1e94c0cdab296ad14b29f8f874431 100644 --- a/templates/types/streaming/nextjs/README-template.md +++ b/templates/types/streaming/nextjs/README-template.md @@ -43,13 +43,13 @@ docker run \ --rm \ -v $(pwd)/.env:/app/.env \ # Use ENV variables and configuration from your file-system -v $(pwd)/config:/app/config \ - -v $(pwd)/cache:/app/cache \ # Use your file system to store gea vector database - -p 3000:3000 \ + -v $(pwd)/data:/app/data \ + -v $(pwd)/cache:/app/cache \ # Use your file system to store the vector database <your_app_image_name> \ npm run generate ``` -3. Start the API +3. Start the app: ``` docker run \