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

Add Docker Compose support #1238

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,8 @@ Create a `DOTENV_LOCAL` secret to your HF space with the content of your .env.lo

## Building

### Local

To create a production version of your app:

```bash
Expand All @@ -917,6 +919,21 @@ You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

### Docker Compose

If `.env.local` is not present, remove the volume in `compose.yaml` as follows to avoid errors.

```diff
- volumes:
- - .env.local:/app/.env.local
```

Start the app with Docker Compose:

```bash
docker compose --env-file /dev/null up --build
```

## Config changes for HuggingChat

The config file for HuggingChat is stored in the `chart/env/prod.yaml` file. It is the source of truth for the environment variables used for our CI/CD pipeline. For HuggingChat, as we need to customize the app color, as well as the base path, we build a custom docker image. You can find the workflow here.
Expand Down
26 changes: 26 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
services:
mongo:
image: mongo:latest
expose:
- 27017
networks:
- huggingchat-mongo
restart: always

huggingchat:
image: chat-ui:latest
ports:
- "3000:3000"
depends_on:
- mongo
networks:
- huggingchat-mongo
volumes:
- .env.local:/app/.env.local
environment:
- MONGODB_URL=mongodb://mongo:27017
restart: always

networks:
huggingchat-mongo:
driver: bridge