-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (48 loc) · 1.23 KB
/
docker-compose.yml
File metadata and controls
52 lines (48 loc) · 1.23 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
# If host port 5432 is taken: POSTGRES_PORT=5433 docker compose up --build
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: saldra
POSTGRES_PASSWORD: saldra
POSTGRES_DB: saldra
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U saldra -d saldra"]
interval: 3s
timeout: 3s
retries: 10
api:
build: .
environment:
DATABASE_URL: postgres://saldra:saldra@postgres:5432/saldra?sslmode=disable
RUN_MIGRATIONS: "true"
HTTP_ADDR: ":8080"
LOG_LEVEL: info
LOG_FORMAT: json
HTTP_READ_HEADER_TIMEOUT: 10s
HTTP_REQUEST_TIMEOUT: 60s
SHUTDOWN_TIMEOUT: 15s
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
worker:
build: .
command: ["/app/worker"]
environment:
DATABASE_URL: postgres://saldra:saldra@postgres:5432/saldra?sslmode=disable
LOG_LEVEL: info
LOG_FORMAT: json
WORKER_POLL_INTERVAL: 2s
WORKER_STALE_LOCK_AFTER: 15m
SHUTDOWN_TIMEOUT: 15s
depends_on:
postgres:
condition: service_healthy
volumes:
pgdata: