auth-api/docker-compose.yml
Lilleman 1b043afb78
All checks were successful
continuous-integration/drone/push Build is passing
Disable external port for postgres
2023-05-16 22:50:17 +02:00

56 lines
1.2 KiB
YAML

version: '3.9'
services:
postgres:
image: postgres:15.2-alpine3.17
user: postgres
environment:
- POSTGRES_USER=postgres
- 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_started
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