version: "3.9" 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} 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:-} services: app: build: context: . dockerfile: Dockerfile args: PHP_VERSION: ${PHP_VERSION:-8.3} NODE_VERSION: ${NODE_VERSION:-20} image: fotospiel-app:latest 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 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 web: image: nginx:1.27-alpine depends_on: app: condition: service_healthy volumes: - app-code:/var/www/html:ro - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro networks: - default - coolify labels: - traefik.enable=true - traefik.docker.network=coolify - traefik.http.middlewares.fotospiel-test-redirect.redirectscheme.scheme=https - traefik.http.routers.fotospiel-test-http.entryPoints=http - "traefik.http.routers.fotospiel-test-http.rule=Host(`test-y0k0.fotospiel.app`)" - traefik.http.routers.fotospiel-test-http.middlewares=fotospiel-test-redirect - traefik.http.routers.fotospiel-test-https.entryPoints=https - "traefik.http.routers.fotospiel-test-https.rule=Host(`test-y0k0.fotospiel.app`)" - "traefik.http.routers.fotospiel-redirect.rule=Host(`www.fotospiel.app`)" - traefik.http.routers.fotospiel-redirect.entrypoints=websecure - traefik.http.routers.fotospiel-redirect.tls=true - traefik.http.routers.fotospiel-redirect.middlewares=fotospiel-redirect - traefik.http.middlewares.fotospiel-redirect.redirectscheme.scheme=https - traefik.http.middlewares.fotospiel-redirect.redirectscheme.permanent=true - traefik.http.middlewares.fotospiel-redirect.redirectscheme.port=443 - traefik.http.middlewares.fotospiel-redirect.redirectscheme.hostname=fotospiel.app - traefik.http.routers.fotospiel-test-https.tls=true - traefik.http.routers.fotospiel-test-https.tls.certresolver=letsencrypt - traefik.http.routers.fotospiel-test-https.service=fotospiel-test - traefik.http.services.fotospiel-test.loadbalancer.server.port=80 restart: unless-stopped queue: image: fotospiel-app:latest command: /var/www/html/docs/queue-supervisor/queue-worker.sh default environment: <<: *app-env SKIP_CODE_SYNC: "1" volumes: - app-code:/var/www/html depends_on: app: condition: service_healthy redis: condition: service_started restart: unless-stopped media-storage-worker: image: fotospiel-app:latest command: /var/www/html/docs/queue-supervisor/queue-worker.sh media-storage environment: <<: *app-env QUEUE_TRIES: 5 QUEUE_SLEEP: 5 SKIP_CODE_SYNC: "1" volumes: - app-code:/var/www/html depends_on: app: condition: service_healthy redis: condition: service_started restart: unless-stopped scheduler: image: fotospiel-app:latest command: php artisan schedule:work environment: <<: *app-env SKIP_CODE_SYNC: "1" volumes: - app-code:/var/www/html depends_on: app: condition: service_healthy restart: unless-stopped horizon: image: fotospiel-app:latest command: /var/www/html/docs/queue-supervisor/horizon.sh environment: <<: *app-env SKIP_CODE_SYNC: "1" volumes: - app-code:/var/www/html 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: mysql-data: redis-data: networks: coolify: external: true