-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
64 lines (62 loc) · 1.57 KB
/
docker-compose.yaml
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
version: '3.8'
services:
app:
build:
context: .
target: production
container_name: "wordle-app"
ports:
- "9000:9000"
environment:
- POSTGRES_URL=postgresql://postgres:postgres@db:5432/wordle?sslmode=disable
- PORT=9000
- PASETO_KEY=12345678901234567890123456789012
- REDIS_URL=redis://redis:6379
- ALLOWED_ORIGINS=http://localhost:3000
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9000/health"]
interval: 10s
timeout: 30s
retries: 5
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
redis:
image: redis:latest
container_name: "wordle-redis"
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
db:
container_name: "wordle-db"
image: postgres:latest
restart: always
environment:
- POSTGRES_USERNAME=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=wordle
ports:
- "5432:5432"
volumes:
- db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "wordle"]
interval: 10s
timeout: 30s
retries: 5
db-migrate:
image: dekuyo/migrate-go:latest
volumes:
- ./repository/postgres/migrations:/migrations
command: [ "-dir", "/migrations", "-dsn", "postgres://postgres:postgres@db:5432/wordle?sslmode=disable" ]
depends_on:
db:
condition: service_healthy
volumes:
db: