-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (32 loc) · 949 Bytes
/
docker-compose.yml
File metadata and controls
35 lines (32 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
version: "3.8"
services:
fastapi:
image: python:3.11-slim
working_dir: /srv/app
command: >
bash -c "
pip install --no-cache-dir -r requirements.txt &&
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
ports:
- "5000:8000"
volumes:
# Mount the entire ai-service directory as the app directory
- ./ai-service:/srv/app
# Mount the database file from the project root
- ./writegeist.db:/srv/writegeist.db
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.fastapi.rule=Host(`python-fastapi-u50080.vm.elestio.app`)"
- "traefik.http.routers.fastapi.entrypoints=websecure"
- "traefik.http.services.fastapi.loadbalancer.server.port=8000"
mongo:
image: mongo:6
restart: always
volumes:
- mongo_data:/data/db
volumes:
mongo_data: