auth-api/compose.yml

57 lines
1.2 KiB
YAML
Raw Normal View History

2021-06-22 22:52:48 +02:00
version: '3.9'
services:
postgres:
2024-02-04 04:33:02 +01:00
image: postgres:16.1-alpine3.19
2023-05-08 15:29:19 +02:00
user: postgres
2021-06-22 22:52:48 +02:00
environment:
2022-02-27 19:29:56 +01:00
- POSTGRES_PASSWORD=prutt
2021-06-22 22:52:48 +02:00
- POSTGRES_DB=auth
2024-02-11 22:37:04 +01:00
ports:
- 5432:5432
2023-05-08 15:29:19 +02:00
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 3s
timeout: 10s
retries: 5
start_period: 80s
2021-06-22 22:52:48 +02:00
db-migrations:
build:
context: .
dockerfile: Dockerfile.migrations
2021-06-22 22:52:48 +02:00
environment:
2022-02-27 19:29:56 +01:00
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
2022-01-22 15:51:14 +01:00
command: ["--wait", "up"]
2021-06-22 22:52:48 +02:00
depends_on:
2023-05-08 15:29:19 +02:00
postgres:
2024-02-04 04:15:44 +01:00
condition: service_healthy
2021-06-22 22:52:48 +02:00
2023-05-08 15:29:19 +02:00
api:
2021-06-22 22:52:48 +02:00
build: .
environment:
- ADMIN_API_KEY=hihi
2022-02-27 19:29:56 +01:00
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
2021-06-22 22:52:48 +02:00
- JWT_SHARED_SECRET=hihi
2023-05-08 15:29:19 +02:00
- LOG_MIN_LVL=Debug
2024-02-04 06:46:48 +01:00
- URL_PREFIX=/
- WEB_BIND_HOST=:4000
- PUBLIC_HOST=localhost:4000
2021-06-22 22:52:48 +02:00
depends_on:
2023-05-08 15:29:19 +02:00
db-migrations:
condition: service_completed_successfully
2021-06-22 22:52:48 +02:00
ports:
2021-06-23 22:59:27 +02:00
- 4000:4000
tests:
build:
context: tests
environment:
- ADMIN_API_KEY=hihi
2023-05-08 15:29:19 +02:00
- AUTH_URL=http://api:4000
2021-06-23 22:59:27 +02:00
- JWT_SHARED_SECRET=hihi
profiles: ["tests"]
depends_on:
2023-05-08 15:29:19 +02:00
api:
condition: service_started