38 lines
722 B
YAML
38 lines
722 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- 5422:5432
|
|
environment:
|
|
- POSTGRES_PASSWORD=secret
|
|
- POSTGRES_USER=root
|
|
- POSTGRES_DB=gh
|
|
networks:
|
|
- app
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U root -d gh"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
migrate:
|
|
image: migrate/migrate
|
|
volumes:
|
|
- ./db/migrations:/migrations
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command:
|
|
[
|
|
"-path",
|
|
"/migrations",
|
|
"-database",
|
|
"postgresql://root:secret@postgres:5432/gh?sslmode=disable",
|
|
"up",
|
|
]
|
|
networks:
|
|
- app
|
|
|
|
networks:
|
|
app:
|
|
driver: bridge
|