Files
fotospiel-app/docker-compose.dokploy.yml
Codex Agent 35d8c94c11
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
Update Dokploy compose for prod/staging
2026-01-24 11:12:53 +01:00

313 lines
8.1 KiB
YAML

x-app-env: &app-env
APP_NAME: ${APP_NAME:-Fotospiel}
APP_ENV: ${APP_ENV:-production}
APP_DEBUG: ${APP_DEBUG:-false}
APP_URL: ${APP_URL}
APP_KEY: ${APP_KEY}
LOG_CHANNEL: stack
LOG_LEVEL: ${LOG_LEVEL:-info}
SENTRY_LARAVEL_DSN: ${SENTRY_LARAVEL_DSN:-}
SENTRY_ENVIRONMENT: ${SENTRY_ENVIRONMENT:-}
SENTRY_TRACES_SAMPLE_RATE: ${SENTRY_TRACES_SAMPLE_RATE:-0.0}
SENTRY_PROFILES_SAMPLE_RATE: ${SENTRY_PROFILES_SAMPLE_RATE:-0.0}
SENTRY_RELEASE: ${SENTRY_RELEASE:-}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN:-}
SENTRY_ORG: ${SENTRY_ORG:-}
SENTRY_PROJECT: ${SENTRY_PROJECT:-}
SENTRY_URL: ${SENTRY_URL:-https://logsder.fotospiel.app}
VITE_SENTRY_DSN: ${VITE_SENTRY_DSN:-}
VITE_SENTRY_ENV: ${VITE_SENTRY_ENV:-}
VITE_SENTRY_TRACES_SAMPLE_RATE: ${VITE_SENTRY_TRACES_SAMPLE_RATE:-}
VITE_SENTRY_RELEASE: ${VITE_SENTRY_RELEASE:-}
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PORT: 6379
QUEUE_CONNECTION: ${QUEUE_CONNECTION:-redis}
CACHE_DRIVER: ${CACHE_DRIVER:-redis}
SESSION_DRIVER: ${SESSION_DRIVER:-redis}
BROADCAST_DRIVER: log
FILESYSTEM_DISK: ${FILESYSTEM_DISK:-local-ssd}
STORAGE_ALERT_EMAIL: ${STORAGE_ALERT_EMAIL:-}
PHOTOBOOTH_CONTROL_BASE_URL: ${PHOTOBOOTH_CONTROL_BASE_URL:-http://photobooth-ftp:8080}
x-app-build: &app-build
context: .
dockerfile: Dockerfile
target: app
args:
PHP_VERSION: ${PHP_VERSION:-8.3}
NODE_VERSION: ${NODE_VERSION:-22}
cache_from:
- type=local,src=${BUILD_CACHE_DIR:-/var/lib/fotospiel-buildcache}
cache_to:
- type=local,dest=${BUILD_CACHE_DIR:-/var/lib/fotospiel-buildcache},mode=max
services:
app:
build: *app-build
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
environment:
<<: *app-env
APP_SOURCE: /opt/app
APP_TARGET: /var/www/html
APP_USER: www-data
APP_GROUP: www-data
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
healthcheck:
test:
- CMD
- php
- -r
- "exit(file_exists('/var/www/html/vendor/autoload.php') ? 0 : 1);"
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
docs-build:
image: node:22
working_dir: /var/www/html/docs/site
command:
- bash
- -lc
- npm install -g npm@11 && npm ci && npm run build
volumes:
- app-code:/var/www/html
env_file:
- path: .env
environment:
VITE_SENTRY_DSN: ${VITE_SENTRY_DSN:-}
VITE_SENTRY_ENV: ${VITE_SENTRY_ENV:-}
VITE_SENTRY_RELEASE: ${VITE_SENTRY_RELEASE:-}
depends_on:
app:
condition: service_healthy
restart: "no"
photobooth-uploader-build:
image: mcr.microsoft.com/dotnet/sdk:10.0
working_dir: /var/www/html
command:
- bash
- -lc
- /var/www/html/scripts/build-photobooth-uploader.sh
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
NUGET_PACKAGES: /root/.nuget/packages
volumes:
- app-code:/var/www/html
- nuget-cache:/root/.nuget/packages
depends_on:
app:
condition: service_healthy
restart: "no"
help-sync:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: php artisan help:sync
environment:
<<: *app-env
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
depends_on:
app:
condition: service_healthy
redis:
condition: service_started
restart: "no"
web:
image: nginx:1.27-alpine
depends_on:
docs-build:
condition: service_completed_successfully
app:
condition: service_healthy
volumes:
- app-code:/var/www/html:ro
- app-storage:/var/www/html/storage:ro
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/nginx/.htpasswd-docs:/etc/nginx/.htpasswd-docs:ro
env_file:
- path: .env
networks:
- default
- dokploy-network
restart: unless-stopped
queue:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: /var/www/html/scripts/queue-worker.sh default,notifications,webhooks
environment:
<<: *app-env
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
app:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
media-storage-worker:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: /var/www/html/scripts/queue-worker.sh media-storage
environment:
<<: *app-env
QUEUE_TRIES: 5
QUEUE_SLEEP: 5
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
app:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
media-security-worker:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: /var/www/html/scripts/queue-worker.sh media-security
environment:
<<: *app-env
QUEUE_TRIES: 3
QUEUE_SLEEP: 5
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
app:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
scheduler:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: php artisan schedule:work
environment:
<<: *app-env
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
app:
condition: service_healthy
restart: unless-stopped
horizon:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
- path: .env
command: /var/www/html/scripts/horizon.sh
environment:
<<: *app-env
SKIP_CODE_SYNC: "1"
volumes:
- app-code:/var/www/html
- app-storage:/var/www/html/storage
- app-bootstrap-cache:/var/www/html/bootstrap/cache
networks:
- default
depends_on:
app:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
redis:
image: redis:7.4-alpine
command:
- redis-server
- "--save"
- ""
- "--appendonly"
- "no"
- "--requirepass"
- "${REDIS_PASSWORD}"
volumes:
- redis-data:/data
restart: unless-stopped
mysql:
image: mysql:8.4
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-p${DB_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
app-code:
app-storage:
external: true
name: fotospiel-${APP_ENV:-prod}-storage
app-bootstrap-cache:
nuget-cache:
mysql-data:
redis-data:
networks:
dokploy-network:
external: true