-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yaml
More file actions
140 lines (132 loc) · 4.17 KB
/
docker-compose.dev.yaml
File metadata and controls
140 lines (132 loc) · 4.17 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
services:
db:
image: postgres:15
container_name: nxtchess_db
profiles: ["db", "backend", "full"]
environment:
POSTGRES_DB: chess_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 3s
retries: 5
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/00_init.sql:ro
# Migrations (run in order before seeds)
- ./db/migrations/000001_add_constraints_and_indexes.up.sql:/docker-entrypoint-initdb.d/01_migration.sql:ro
- ./db/migrations/000002_add_profile_icon.up.sql:/docker-entrypoint-initdb.d/02_migration.sql:ro
- ./db/migrations/000003_add_endgame_positions.up.sql:/docker-entrypoint-initdb.d/03_migration.sql:ro
- ./db/migrations/000004_add_puzzle_rating.up.sql:/docker-entrypoint-initdb.d/04_migration.sql:ro
- ./db/migrations/000005_add_achievements.up.sql:/docker-entrypoint-initdb.d/05_migration.sql:ro
# Seeds (run after migrations)
- ./db/seeds/001_endgame_positions.sql:/docker-entrypoint-initdb.d/90_seed_endgames.sql:ro
- ./db/seeds/endgame_positions_curated.sql:/docker-entrypoint-initdb.d/91_seed_endgames_curated.sql:ro
redis:
image: redis:7
container_name: nxtchess_redis
profiles: ["redis", "backend", "full"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 3s
retries: 5
ports:
- "6379:6379"
backend:
build:
context: ./apps/backend
dockerfile: Dockerfile.dev
container_name: nxtchess_backend
profiles: ["backend", "full"]
env_file: ./apps/backend/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./apps/backend:/app
- go_build_cache:/root/.cache/go-build
- go_mod_cache:/go/pkg/mod
ports:
- "8080:8080"
command: ["go", "run", "cmd/server/main.go"]
frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile.dev
container_name: nxtchess_frontend
profiles: ["frontend", "full"]
environment:
VITE_DEBUG: "true"
VITE_BACKEND_URL: ""
BACKEND_PROXY_URL: "http://backend:8080"
ports:
- "5173:5173"
volumes:
- ./apps/frontend:/app
- /app/node_modules
command: ["yarn", "dev", "--host", "0.0.0.0"]
prometheus:
image: prom/prometheus:latest
container_name: nxtchess_prometheus
profiles: ["monitoring"]
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "9090:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=7d'
loki:
image: grafana/loki:3.0.0
container_name: nxtchess_loki
profiles: ["monitoring"]
volumes:
- ./monitoring/loki.yml:/etc/loki/local-config.yaml:ro
- loki_data:/loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
promtail:
image: grafana/promtail:3.0.0
container_name: nxtchess_promtail
profiles: ["monitoring"]
volumes:
- ./monitoring/promtail.yml:/etc/promtail/config.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
command: -config.file=/etc/promtail/config.yml
depends_on:
- loki
grafana:
image: grafana/grafana:latest
container_name: nxtchess_grafana
profiles: ["monitoring"]
volumes:
- ./monitoring/grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
- ./monitoring/grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/dashboards.yml:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
ports:
- "3000:3000"
depends_on:
- prometheus
- loki
volumes:
db_data:
go_build_cache:
go_mod_cache:
prometheus_data:
loki_data:
grafana_data: