-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (38 loc) · 1.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (38 loc) · 1.1 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
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: "${DB_NAME:-ledger}"
POSTGRES_USER: "${DB_USER:-ledger}"
POSTGRES_PASSWORD: "${DB_PASSWORD:-ledger}"
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-ledger}"]
interval: 5s
timeout: 5s
retries: 5
migrate:
build: .
command: >
sh -c "goose -dir /app/migrations postgres
'postgres://${DB_USER:-ledger}:${DB_PASSWORD:-ledger}@postgres:${DB_PORT:-5432}/${DB_NAME:-ledger}?sslmode=${DB_SSLMODE:-disable}' up"
depends_on:
postgres:
condition: service_healthy
server:
build: .
ports:
- "${APP_PORT:-8084}:8084"
environment:
APP_PORT: "${APP_PORT:-8084}"
LOG_LEVEL: "${LOG_LEVEL:-info}"
DB_HOST: "${DB_HOST:-postgres}"
DB_PORT: "${DB_PORT:-5432}"
DB_USER: "${DB_USER:-ledger}"
DB_PASSWORD: "${DB_PASSWORD:-ledger}"
DB_NAME: "${DB_NAME:-ledger}"
DB_SSLMODE: "${DB_SSLMODE:-disable}"
depends_on:
migrate:
condition: service_completed_successfully