networks: frontend: external: true backend: {} services: # Configuration for the SMR game engine smr: extends: file: abstract-services.yml service: smr-base networks: - frontend - backend labels: - "traefik.enable=true" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-smr.rule=${SMR_HOST_RULE} && PathPrefix(`/`)" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-smr.middlewares=nonwww-to-www@file" depends_on: - mysql - smtp environment: XDEBUG_MODE: DISABLE_PHPDI_COMPILATION: SMR_DEV_ASSETS: volumes: - ./vol_upload:/smr/src/htdocs/upload:rw - ./config:/smr/config:ro # Directory for Xdebug profiler output (if enabled) - ./vol_xdebug:/tmp/xdebug:rw smtp: image: mwader/postfix-relay networks: - backend environment: - POSTFIX_myhostname=${POSTFIX_HOSTNAME:-hostname.local} - OPENDKIM_DOMAINS=smrealms.de=key1 volumes: - ./opendkim:/etc/opendkim/keys/smrealms.de:rw flyway: extends: file: abstract-services.yml service: flyway-base depends_on: - mysql mysql: extends: file: abstract-services.yml service: mysql-base volumes: - ./.my.cnf:/root/.my.cnf:ro - ./vol_db:/var/lib/mysql:rw pma: image: phpmyadmin/phpmyadmin networks: - frontend - backend environment: PMA_HOST: mysql PMA_ABSOLUTE_URI: /pma/ labels: - "traefik.enable=true" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-pma.rule=${SMR_HOST_RULE} && PathPrefix(`/pma`)" - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-pma.middlewares=slash-then-strip@file" depends_on: - mysql discord: extends: file: abstract-services.yml service: smr-cli command: php src/tools/discord/bot.php irc: extends: file: abstract-services.yml service: smr-cli command: php src/tools/irc/irc.php npc: extends: file: abstract-services.yml service: smr-cli command: php src/tools/npc/npc.php restart: "no" traefik: image: traefik:v3.8 networks: - frontend volumes: - /var/run/docker.sock:/var/run/docker.sock:ro # Mount read+write for writing acme.json file in live - ./traefik:/etc/traefik:rw labels: - "traefik.enable=true" - "traefik.http.routers.traefik.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)" - "traefik.http.routers.traefik.service=api@internal" - "traefik.http.routers.traefik.middlewares=add-slash@file" ports: - "80:80" - "443:443" logging: driver: "json-file" options: max-size: "100m" max-file: "7" compress: "true" # Generate rich API documentation of the SMR source code. api-docs: build: context: . dockerfile: ./api-docs/Dockerfile networks: - frontend labels: - "traefik.enable=true" - "traefik.http.routers.api-docs.rule=PathPrefix(`/docs`)" - "traefik.http.routers.api-docs.middlewares=slash-then-strip@file" # Web interface for managing Docker services portainer: image: portainer/portainer-ce networks: - frontend labels: - "traefik.enable=true" - "traefik.http.routers.portainer.rule=PathPrefix(`/docker`)" - "traefik.http.routers.portainer.middlewares=slash-then-strip@file" - "traefik.http.services.portainer.loadbalancer.server.port=9000" command: -H unix:///var/run/docker.sock volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./vol_portainer:/data:rw # Web interface to display Xdebug profiler results webgrind: image: jokkedk/webgrind networks: - frontend labels: - "traefik.enable=true" - "traefik.http.routers.webgrind.rule=PathPrefix(`/webgrind`)" - "traefik.http.routers.webgrind.middlewares=slash-then-strip@file" volumes: # Webgrind looks for Xdebug profiler files in /tmp by default - ./vol_xdebug:/tmp:rw # Files mapped under /host will be available for code lookup - ./src:/host/smr/src:ro secrets: mysql-password: environment: "MYSQL_PASSWORD" mysql-root-password: environment: "MYSQL_ROOT_PASSWORD"