x-app-common: &app-common image: wormhole-systems:production build: context: . dockerfile: dockerfiles/common/frankenPHP/Dockerfile args: - VITE_REVERB_APP_KEY - VITE_REVERB_HOST - VITE_REVERB_PORT - VITE_REVERB_SCHEME env_file: - .env networks: - ws-internal volumes: - laravel-storage:/app/storage - ./dockerfiles/common/frankenPHP/php.ini:/usr/local/etc/php/conf.d/custom.ini services: app: <<: *app-common networks: - ws-internal - web volumes: - laravel-storage:/app/storage - caddy_data:/data - caddy_config:/config - ./dockerfiles/common/frankenPHP/php.ini:/usr/local/etc/php/conf.d/custom.ini restart: unless-stopped healthcheck: test: ["CMD", "curl", "--fail", "http://127.0.0.1:80/up"] interval: 10s timeout: 5s retries: 3 depends_on: mysql: condition: service_healthy redis: condition: service_healthy labels: - "traefik.enable=true" - "traefik.docker.network=web" - "traefik.http.routers.wormholesystems.service=app" # IMPORTANT: Traefik now talks directly to the Caddy server (FrankenPHP) on its default port 80 - "traefik.http.services.app.loadbalancer.server.port=80" - "traefik.http.routers.wormholesystems.rule=Host(`${APP_DOMAIN}`)" - "traefik.http.routers.wormholesystems.entrypoints=websecure" - "traefik.http.routers.wormholesystems.tls.certresolver=primary" - "traefik.http.middlewares.secure-headers.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.middlewares.secure-headers.headers.customrequestheaders.X-Forwarded-For=" - "traefik.http.routers.wormholesystems.middlewares=secure-headers" mysql: image: mariadb:11.2 hostname: mysql env_file: - dockerfiles/mysql/.env networks: - ws-internal volumes: - mysql-data:/var/lib/mysql - mysql-logs:/var/log/mysql restart: unless-stopped healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] start_period: 10s interval: 10s timeout: 5s retries: 3 redis: image: redis:7.2 hostname: redis networks: - ws-internal volumes: - redis-logs:/var/log/redis restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 3 queue: <<: *app-common tty: true deploy: mode: replicated replicas: 10 command: php artisan queue:work --sleep=3 --tries=3 --max-time=3600 restart: unless-stopped depends_on: app: condition: service_healthy healthcheck: test: ["CMD", "pgrep", "-f", "php artisan queue:work"] interval: 10s timeout: 5s retries: 3 scheduler: <<: *app-common tty: true command: ["supercronic", "-overlapping", "/etc/supercronic/laravel"] restart: unless-stopped depends_on: app: condition: service_healthy healthcheck: test: ["CMD", "pgrep", "-f", "php /app/artisan schedule:run"] interval: 10s timeout: 5s retries: 3 killmail-listener: <<: *app-common tty: true command: php artisan app:listen-for-killmails restart: unless-stopped depends_on: app: condition: service_healthy healthcheck: test: ["CMD", "pgrep", "-f", "php artisan app:listen-for-killmails"] interval: 10s timeout: 5s retries: 3 reverb: <<: *app-common tty: true networks: - ws-internal - web depends_on: app: condition: service_healthy command: php artisan reverb:start --host=${REVERB_SERVER_HOST:-0.0.0.0} --port=${REVERB_PORT:-8080} --debug restart: ${RESTART_POLICY:-always} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/up"] interval: 10s timeout: 5s retries: 3 labels: - "traefik.enable=true" - "traefik.docker.network=web" - "traefik.http.routers.wormholesystems-reverb.service=reverb" - "traefik.http.routers.wormholesystems-reverb.middlewares=reverb-ws@docker" - "traefik.http.middlewares.reverb-ws.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.middlewares.reverb-ws.headers.customrequestheaders.Upgrade=websocket" - "traefik.http.middlewares.reverb-ws.headers.customrequestheaders.Connection=Upgrade" - "traefik.http.routers.wormholesystems-reverb.rule=Host(`${WS_DOMAIN}`) && PathPrefix(`/app`)" - "traefik.http.routers.wormholesystems-reverb.entrypoints=websecure" - "traefik.http.routers.wormholesystems-reverb.tls.certresolver=primary" - "traefik.http.services.reverb.loadbalancer.server.port=${REVERB_PORT:-8080}" # if you use the deeper discord integration you will need to uncomment the discord serice in the docker-compose.yml and set these values, otherwise you can leave them as is # discord: # <<: *app-common # tty: true # command: php artisan discord:listen # restart: unless-stopped # depends_on: # app: # condition: service_healthy # healthcheck: # test: ["CMD", "pgrep", "-f", "php artisan discord:listen"] # interval: 10s # timeout: 5s # retries: 3 volumes: mysql-data: laravel-storage: caddy_data: caddy_config: # Log volumes for persistent storage mysql-logs: redis-logs: networks: ws-internal: web: external: true