-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
90 lines (84 loc) · 1.95 KB
/
docker-compose.example.yml
File metadata and controls
90 lines (84 loc) · 1.95 KB
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
version: "3.9"
services:
# -----------------------------
# Database (Postgres + Vector)
# -----------------------------
db:
image: pgvector/pgvector:pg16
container_name: example_db
profiles:
- prod
environment:
POSTGRES_USER: ${DB_USER:-appuser}
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
POSTGRES_DB: ${DB_NAME:-appdb}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
# Exposed for local development only
- "5432:5432"
networks:
- app_net
# -----------------------------
# Backend API
# -----------------------------
api:
build:
context: ./api
dockerfile: Dockerfile
container_name: example_api
environment:
DATABASE_URL: postgres://${DB_USER:-appuser}:${DB_PASSWORD:-changeme}@db:5432/${DB_NAME:-appdb}
APP_ENV: ${APP_ENV:-development}
depends_on:
- db
ports:
- "8000:8000"
networks:
- app_net
# -----------------------------
# Background Worker
# -----------------------------
worker:
build:
context: ./worker
dockerfile: Dockerfile
container_name: example_worker
environment:
DATABASE_URL: postgres://${DB_USER:-appuser}:${DB_PASSWORD:-changeme}@db:5432/${DB_NAME:-appdb}
depends_on:
- db
volumes:
- worker_shared:/shared
networks:
- app_net
# -----------------------------
# Frontend
# -----------------------------
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: example_frontend
ports:
- "3000:3000"
volumes:
# For local dev hot-reload
- ./frontend:/app
- /app/node_modules
depends_on:
- api
networks:
- app_net
# -----------------------------
# Volumes
# -----------------------------
volumes:
postgres_data:
worker_shared:
# -----------------------------
# Networks
# -----------------------------
networks:
app_net:
driver: bridge