Files
oauth/docker-compose.yml
2026-07-27 18:14:10 +02:00

100 lines
2.5 KiB
YAML

name: oauth-iam
services:
app:
build:
context: .
target: app
image: oauth-iam-app:latest
restart: unless-stopped
environment:
CONTAINER_ROLE: app
volumes:
- app_storage:/var/www/html/storage
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "9000"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
queue:
build:
context: .
target: app
image: oauth-iam-app:latest
restart: unless-stopped
command: php artisan queue:work redis --sleep=3 --tries=3 --max-time=3600
volumes:
- app_storage:/var/www/html/storage
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
scheduler:
build:
context: .
target: app
image: oauth-iam-app:latest
restart: unless-stopped
command: php artisan schedule:work
volumes:
- app_storage:/var/www/html/storage
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
nginx:
build:
context: .
target: nginx
restart: unless-stopped
ports:
- "80:80"
# - "443:443"
volumes:
- ./docker/nginx/certs:/etc/nginx/certs:ro
depends_on:
- app
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --save 60 1 --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
app_storage:
db_data:
redis_data: