-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (95 loc) · 2.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (95 loc) · 2.6 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
services:
db:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-esolang_battle_2}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-esolang_battle_2}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
migration:
build:
context: .
target: migration
environment:
DATABASE_URL: ${DATABASE_URL_INTERNAL}
depends_on:
db:
condition: service_healthy
web:
build:
context: .
target: web
restart: unless-stopped
ports:
- "3000:3000" # might be overridden in docker-compose.override.yml
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migration:
condition: service_completed_successfully
environment:
DATABASE_URL: ${DATABASE_URL_INTERNAL}
REDIS_HOST: ${REDIS_HOST_INTERNAL}
REDIS_PORT: ${REDIS_PORT_INTERNAL:-6379}
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
SLACK_CLIENT_ID: ${SLACK_CLIENT_ID}
SLACK_CLIENT_SECRET: ${SLACK_CLIENT_SECRET}
worker:
build:
context: .
target: worker
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migration:
condition: service_completed_successfully
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DATABASE_URL: ${DATABASE_URL_INTERNAL}
REDIS_HOST: ${REDIS_HOST_INTERNAL}
REDIS_PORT: ${REDIS_PORT_INTERNAL:-6379}
DOCKER_HOST: unix:///var/run/docker.sock
# You can add more worker instances if needed for load balancing
worker2:
build:
context: .
target: worker
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migration:
condition: service_completed_successfully
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DATABASE_URL: ${DATABASE_URL_INTERNAL}
REDIS_HOST: ${REDIS_HOST_INTERNAL}
REDIS_PORT: ${REDIS_PORT_INTERNAL:-6379}
DOCKER_HOST: unix:///var/run/docker.sock
volumes:
db-data: