Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up docker compose #129

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ OpenGPTs gives you more control, allowing you to configure:
</p>

**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)
Expand Down Expand Up @@ -103,16 +104,19 @@ 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
```

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:**
Expand All @@ -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.

Expand Down Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -12,16 +12,17 @@ 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:
- .env
volumes:
- ./backend:/backend
environment:
PORT: 8100
REDIS_URL: "redis://redis:6379"
command:
- --reload

frontend:
build:
Expand All @@ -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"