auth-api/compose.yml
2024-02-04 04:15:44 +01:00

55 lines
1.2 KiB
YAML

version: '3.9'
services:
postgres:
image: postgres:15.2-alpine3.17
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
- WEB_BIND_HOST=:4000
- LOG_MIN_LVL=Debug
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