-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
45 lines (43 loc) · 1.05 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
version: "3.9"
name: gen
services:
grpc:
build:
dockerfile: ./build/grpc/Dockerfile
target: dev
environment:
DB_URL: "postgres://postgres:secret123@db:5432/payroll?sslmode=disable"
depends_on:
db:
condition: service_healthy
ports:
- "8000:8000"
volumes:
- ./:/src/
db:
image: "postgres:15.2-alpine"
environment:
POSTGRES_DB: payroll
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret123
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 3s
timeout: 60s
retries: 10
start_period: 5s
ports:
- "5432:5432"
migrate:
build:
dockerfile: build/migrate/Dockerfile
target: builder
environment:
DB_URL: "postgres://postgres:secret123@db:5432/payroll?sslmode=disable"
depends_on:
db:
condition: service_healthy
volumes:
- ./db/migrations/:/db/migrations/
- ./db/seeds/:/db/seeds/
- ./db/run-dev-migrations:/db/run-dev-migrations