57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16.1-alpine3.19
|
|
user: postgres
|
|
environment:
|
|
- POSTGRES_PASSWORD=prutt
|
|
- POSTGRES_DB=auth
|
|
# ports:
|
|
# - 5432:5432
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready"]
|
|
interval: 3s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 80s
|
|
|
|
db-migrations:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.migrations
|
|
environment:
|
|
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
|
|
command: ["--wait", "up"]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
api:
|
|
build: .
|
|
environment:
|
|
- ADMIN_API_KEY=hihi
|
|
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
|
|
- JWT_SHARED_SECRET=hihi
|
|
- LOG_MIN_LVL=Debug
|
|
- URL_PREFIX=/
|
|
- WEB_BIND_HOST=:4000
|
|
- PUBLIC_HOST=localhost:4000
|
|
depends_on:
|
|
db-migrations:
|
|
condition: service_completed_successfully
|
|
ports:
|
|
- 4000:4000
|
|
|
|
tests:
|
|
build:
|
|
context: tests
|
|
environment:
|
|
- ADMIN_API_KEY=hihi
|
|
- AUTH_URL=http://api:4000
|
|
- JWT_SHARED_SECRET=hihi
|
|
profiles: ["tests"]
|
|
depends_on:
|
|
api:
|
|
condition: service_started
|