From e0506db6702e8196d44426a6347680ff0c87039e Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 18 Jan 2024 10:17:53 -0800 Subject: [PATCH] Fix up docker compose - make reload an arg only in docker compose (we dont want reload in prod) - use redis image which is compatible with arm cpus --- README.md | 7 ++++++- backend/Dockerfile | 2 +- docker-compose.yml | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bbb4e70..48c8040f 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ OpenGPTs gives you more control, allowing you to configure:

**Key Links** + - [GPTs: a simple hosted version](https://opengpts-example-vz4y4ooboq-uc.a.run.app/) - [Assistants API: a getting started guide](API.md) - [Memory: how to use long-term memory](MEMORY.md) @@ -103,6 +104,7 @@ This project supports a Docker-based setup, streamlining installation and execut 1. **Clone the Repository:** Obtain the project files by cloning the repository. + ``` git clone https://github.com/langchain-ai/opengpts.git cd opengpts @@ -110,9 +112,11 @@ This project supports a Docker-based setup, streamlining installation and execut 2. **Run with Docker Compose:** In the root directory of the project, execute: + ``` docker compose up ``` + This command builds the Docker images for the frontend and backend from their respective Dockerfiles and starts all necessary services, including Redis. 3. **Access the Application:** @@ -126,6 +130,7 @@ This project supports a Docker-based setup, streamlining installation and execut This command rebuilds the images with your latest changes and restarts the services. ### Note + - Ensure Docker and docker-compose are installed on your system. - Adjust the `.env` file as required for specific environment configurations. @@ -314,5 +319,5 @@ You can deploy to GCP Cloud Run using the following command: First create a `.env.gcp.yaml` file with the contents from `.env.gcp.yaml.example` and fill in the values. Then run: ```shell -gcloud run deploy opengpts --source . --port 8001 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1 +gcloud run deploy opengpts --source . --port 8000 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1 ``` diff --git a/backend/Dockerfile b/backend/Dockerfile index 22f45394..184776f9 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -13,4 +13,4 @@ RUN rm poetry.lock RUN pip install . -CMD exec uvicorn app.server:app --host 0.0.0.0 --port $PORT --reload +ENTRYPOINT [ "uvicorn", "app.server:app", "--host", "0.0.0.0" ] diff --git a/docker-compose.yml b/docker-compose.yml index e7836761..778bc473 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: redis: container_name: redis - image: redislabs/redisearch:latest + image: redis/redis-stack-server:latest ports: - "6379:6379" volumes: @@ -12,7 +12,7 @@ services: build: context: backend ports: - - "8100:8100" # Backend is accessible on localhost:8100 + - "8100:8000" # Backend is accessible on localhost:8100 depends_on: - redis env_file: @@ -20,8 +20,9 @@ services: volumes: - ./backend:/backend environment: - PORT: 8100 REDIS_URL: "redis://redis:6379" + command: + - --reload frontend: build: @@ -31,4 +32,4 @@ services: ports: - "5173:5173" # Frontend is accessible on localhost:5173 environment: - VITE_BACKEND_URL: "http://backend:8100" + VITE_BACKEND_URL: "http://backend:8000"