textsender_auth Build / Rustfmt (push) Successful in 44s
textsender_auth Build / Check (push) Successful in 1m42s
textsender_auth Build / Test Suite (push) Successful in 2m5s
textsender_auth Build / Clippy (push) Successful in 1m38s
textsender_auth Build / build (push) Successful in 3m5s
Reviewed-on: phoenix/textsender_auth#21
43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
version: '3.8' # Use a recent version
|
|
|
|
services:
|
|
auth_api:
|
|
build:
|
|
context: .
|
|
ssh: ["default"]
|
|
container_name: textsender_auth
|
|
ports:
|
|
- "9080:9080"
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
auth_db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# PostgreSQL Database Service
|
|
auth_db:
|
|
image: postgres:18.4-alpine
|
|
container_name: textsender_auth_db
|
|
environment:
|
|
POSTGRES_USER: ${DB_AUTH_USER:-textsender_op}
|
|
POSTGRES_PASSWORD: ${DB_AUTH_PASSWORD:-password}
|
|
POSTGRES_DB: ${DB_AUTH_NAME:-textsender_auth_db}
|
|
volumes:
|
|
# Persist database data using a named volume
|
|
- postgres_data:/var/lib/postgresql
|
|
ports:
|
|
- "5433:5432"
|
|
healthcheck:
|
|
# Checks if Postgres is ready to accept connections
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
restart: always
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|