Laravel-based OAuth/IAM service with Passport, Vue 3 frontend, and Docker Compose setup for local and production deployment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
103 lines
2.6 KiB
YAML
103 lines
2.6 KiB
YAML
name: oauth-iam
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
target: app
|
|
image: oauth-iam-app:latest
|
|
restart: unless-stopped
|
|
environment:
|
|
CONTAINER_ROLE: app
|
|
env_file: .env.production
|
|
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
|
|
env_file: .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
|
|
env_file: .env.production
|
|
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:
|