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

138 lines
3.7 KiB
YAML

name: oauth-iam
x-app-env: &app-env
APP_NAME: ${APP_NAME}
APP_ENV: ${APP_ENV}
APP_KEY: ${APP_KEY}
APP_DEBUG: ${APP_DEBUG}
APP_URL: ${APP_URL}
APP_LOCALE: ${APP_LOCALE}
APP_FALLBACK_LOCALE: ${APP_FALLBACK_LOCALE}
APP_FAKER_LOCALE: ${APP_FAKER_LOCALE}
LOG_CHANNEL: ${LOG_CHANNEL}
LOG_STACK: ${LOG_STACK}
LOG_LEVEL: ${LOG_LEVEL}
DB_CONNECTION: ${DB_CONNECTION}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SESSION_DRIVER: ${SESSION_DRIVER}
SESSION_LIFETIME: ${SESSION_LIFETIME}
SESSION_ENCRYPT: ${SESSION_ENCRYPT}
SESSION_SECURE_COOKIE: ${SESSION_SECURE_COOKIE}
SESSION_DOMAIN: ${SESSION_DOMAIN}
CACHE_STORE: ${CACHE_STORE}
QUEUE_CONNECTION: ${QUEUE_CONNECTION}
REDIS_CLIENT: ${REDIS_CLIENT}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PASSWORD: ${REDIS_PASSWORD}
FILESYSTEM_DISK: ${FILESYSTEM_DISK}
MAIL_MAILER: ${MAIL_MAILER}
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS}
MAIL_FROM_NAME: ${MAIL_FROM_NAME}
L5_SWAGGER_GENERATE_ALWAYS: ${L5_SWAGGER_GENERATE_ALWAYS}
VITE_APP_NAME: ${VITE_APP_NAME}
services:
app:
build:
context: .
target: app
image: oauth-iam-app:latest
restart: unless-stopped
environment:
<<: *app-env
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
environment: *app-env
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
environment: *app-env
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
expose:
- "80"
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: