-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
93 lines (86 loc) · 2.68 KB
/
docker-compose.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: '3.8'
services:
timescaledb:
image: timescale/timescaledb-ha:pg16
container_name: timescaledb
environment:
POSTGRES_PASSWORD: password
#OPENAI_API_KEY: ${OPENAI_API_KEY}
ports:
- "5432:5432" # this is to allow direct connections to db, in prod should be removed
volumes:
- timescale_data:/var/lib/postgresql/data
networks:
- ollama
- db
- web # this is to allow direct connections to db, in prod should be removed
ollama:
image: ollama/ollama:latest
#build:
# context: ./ollama
container_name: ollama
# ports:
# - "11434:11434"
volumes:
- ollama_data:/root/.ollama
environment:
- MODEL_ENDPOINT_MXBAI=mxbai-embed-large
- MODEL_ENDPOINT_LLAMA=llama3.2
networks:
- ollama
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [gpu] # Uncomment if using GPU support
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected] # Set default pgAdmin login email
PGADMIN_DEFAULT_PASSWORD: admin # Set default pgAdmin password
ports:
- "8765:80" # Expose pgAdmin on port 8765
networks:
- db
- web
app:
build:
context: ./py # Assumes your FastAPI app and Dockerfile are in the same directory
container_name: fastapi_app
environment:
DATABASE_URL: postgresql://postgres:password@timescaledb:5432/postgres # Update if database name changes
OPENAI_API_KEY: ${OPENAI_API_KEY}
volumes:
- ./py/app:/app
ports:
- "8000:8000" # Expose FastAPI on port 8000
depends_on:
- timescaledb
- ollama
networks:
- ollama
- db
- web
labels:
- "traefik.enable=true" # Enable Traefik for this container
- "traefik.docker.network=web" # Network to route through
- "traefik.http.routers.gitconecom-router.rule=Host(`gitcone.com`, `www.gitcone.com`, `static.gitcone.com`)" # Define hostnames for the router
- "traefik.http.routers.gitconecom-router.entrypoints=secure" # Use the secure (HTTPS) entrypoint
- "traefik.http.routers.gitconecom-router.tls=true" # Enable TLS
- "traefik.http.routers.gitconecom-router.tls.certresolver=le" # Use Let's Encrypt for cert resolution
- "traefik.http.services.gitconecom-service.loadbalancer.server.port=8000" # Internal FastAPI port to expose (adjust if different)
volumes:
timescale_data:
driver: local
ollama_data:
driver: local
# py_app:
# driver: local
networks:
ollama:
driver: bridge
db:
driver: bridge
web:
external: true