-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (45 loc) · 999 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (45 loc) · 999 Bytes
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
services:
db:
image: postgres:18-alpine
environment:
POSTGRES_DB: tasksdb
POSTGRES_USER: tasks
POSTGRES_PASSWORD: tasks
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tasks -d tasksdb"]
interval: 5s
timeout: 5s
retries: 5
migrate:
image: migrate/migrate:v4.17.0
volumes:
- ./migrations:/migrations
depends_on:
db:
condition: service_healthy
entrypoint:
- migrate
- -path
- /migrations
- -database
- postgres://tasks:tasks@db:5432/tasksdb?sslmode=disable
- up
api:
build: .
environment:
PORT: "8080"
DATABASE_URL: "postgres://tasks:tasks@db:5432/tasksdb?sslmode=disable"
ENV: "prod"
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
pgdata: