-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (87 loc) · 2.5 KB
/
docker-compose.yml
File metadata and controls
92 lines (87 loc) · 2.5 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
91
92
services:
postgres:
image: postgres:16-alpine
container_name: specforge_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-specforge}
POSTGRES_USER: ${POSTGRES_USER:-specforge}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-specforge}
ports:
- "5432:5432"
volumes:
- specforge_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-specforge} -d ${POSTGRES_DB:-specforge}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- specforge_network
migrate:
image: migrate/migrate
container_name: specforge_migrate
volumes:
- ./backend/migrations:/migrations
entrypoint: [
"migrate",
"-path", "/migrations/",
"-database", "${DATABASE_URL:-postgres://specforge:specforge@postgres:5432/specforge?sslmode=disable}",
"up"
]
depends_on:
postgres:
condition: service_healthy
networks:
- specforge_network
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: specforge_backend
restart: unless-stopped
environment:
DATABASE_URL: ${DATABASE_URL:-postgres://specforge:specforge@postgres:5432/specforge?sslmode=disable}
JWT_SECRET: ${JWT_SECRET:-supersecret}
ENVIRONMENT: ${ENVIRONMENT:-development}
PORT: 8080
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- specforge_network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8080/api/v1}
container_name: specforge_frontend
restart: unless-stopped
# Environment variables here only affect runtime (nginx), not the baked-in static assets
# keeping them for consistency or if using a runtime injection hack
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8080/api/v1}
ports:
- "5173:80"
depends_on:
backend:
condition: service_healthy
networks:
- specforge_network
networks:
specforge_network:
name: specforge_network
driver: bridge
volumes:
specforge_postgres_data:
name: specforge_postgres_data