| --- | --- | ||||
| networks: | networks: | ||||
| default: | default: | ||||
| external: | |||||
| name: ${DOCKER_PREFIX} | |||||
| name: ${PREFIX} | |||||
| services: | services: | ||||
| adminer: | adminer: | ||||
| container_name: ${DOCKER_PREFIX}-adminer | |||||
| hostname: ${DOCKER_PREFIX}-adminer | |||||
| image: adminer:4.7.2-standalone | |||||
| container_name: ${PREFIX}-adminer | |||||
| hostname: ${PREFIX}-adminer | |||||
| image: adminer:4.8.1-standalone | |||||
| labels: | labels: | ||||
| - traefik.enable=true | - traefik.enable=true | ||||
| - traefik.http.routers.${DOCKER_PREFIX}-adminer.entrypoints=https | |||||
| - traefik.http.routers.${DOCKER_PREFIX}-adminer.rule=Host(`${WP_URL}`) && PathPrefix(`/adminer/`) | |||||
| - traefik.http.routers.${DOCKER_PREFIX}-adminer.tls=true # remove if using LE as default TLS | |||||
| - traefik.http.services.${DOCKER_PREFIX}-adminer.loadbalancer.server.port=8080 | |||||
| - traefik.http.routers.${PREFIX}-adminer.entrypoints=https | |||||
| - traefik.http.routers.${PREFIX}-adminer.rule=Host(`adminer.${APP_URL}`) | |||||
| - traefik.http.routers.${PREFIX}-adminer.tls=true | |||||
| - traefik.http.services.${PREFIX}-adminer.loadbalancer.server.port=8080 | |||||
| app: | |||||
| container_name: ${PREFIX}-app | |||||
| environment: | |||||
| - PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE} | |||||
| - PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE} | |||||
| - XDEBUG_CLIENT_HOST=${XDEBUG_CLIENT_HOST} | |||||
| - XDEBUG_MODE=${XDEBUG_MODE} | |||||
| image: ${APP_IMAGE_TAG} | |||||
| labels: | |||||
| - traefik.enable=true | |||||
| - traefik.http.routers.${PREFIX}-web.entrypoints=http | |||||
| - traefik.http.routers.${PREFIX}-web.middlewares=https-redirect@file | |||||
| - traefik.http.routers.${PREFIX}-web.rule=Host(`${APP_URL}`) | |||||
| - traefik.http.routers.${PREFIX}-webssl.entrypoints=https | |||||
| - traefik.http.routers.${PREFIX}-webssl.rule=Host(`${APP_URL}`) | |||||
| - traefik.http.routers.${PREFIX}-webssl.tls=true | |||||
| - traefik.http.services.${PREFIX}-webssl.loadbalancer.server.port=80 | |||||
| volumes: | |||||
| - webroot:/var/www/html | |||||
| - wp-cli-cache:/var/www/.wp-cli | |||||
| db: | db: | ||||
| command: --default-authentication-plugin=mysql_native_password | command: --default-authentication-plugin=mysql_native_password | ||||
| container_name: ${DOCKER_PREFIX}-db | |||||
| container_name: ${PREFIX}-db | |||||
| environment: | environment: | ||||
| MYSQL_DATABASE: ${DOCKER_PREFIX} | |||||
| MYSQL_DATABASE: ${DB_NAME} | |||||
| MYSQL_PASSWORD: ${DB_USER_PASSWORD} | MYSQL_PASSWORD: ${DB_USER_PASSWORD} | ||||
| MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} | MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} | ||||
| MYSQL_USER: ${DB_USER} | MYSQL_USER: ${DB_USER} | ||||
| hostname: ${DOCKER_PREFIX}-db | |||||
| hostname: ${PREFIX}-db | |||||
| image: mariadb:10.4.6-bionic | image: mariadb:10.4.6-bionic | ||||
| ports: | |||||
| - "${TRAEFIK_LISTENING_IP}:3306:3306" | |||||
| volumes: | volumes: | ||||
| - db:/var/lib/mysql | - db:/var/lib/mysql | ||||
| web: | |||||
| container_name: ${DOCKER_PREFIX}-web | |||||
| image: ${DOCKER_IMAGE_TAG} | |||||
| traefik: | |||||
| container_name: ${PREFIX}-traefik | |||||
| command: ["--configFile=/etc/traefik/static/traefik.yml"] | |||||
| image: traefik:2.5.3 | |||||
| labels: | labels: | ||||
| - traefik.enable=true | - traefik.enable=true | ||||
| - traefik.http.routers.${DOCKER_PREFIX}-web.entrypoints=https | |||||
| - traefik.http.routers.${DOCKER_PREFIX}-web.rule=Host(`${WP_URL}`) | |||||
| - traefik.http.routers.${DOCKER_PREFIX}-web.tls=true # remove if using LE as default TLS provider | |||||
| - traefik.http.services.${DOCKER_PREFIX}-web.loadbalancer.server.port=80 | |||||
| - traefik.http.routers.${PREFIX}-traefik.entrypoints=https | |||||
| - traefik.http.routers.${PREFIX}-traefik.rule=Host(`traefik.${APP_URL}`) | |||||
| - traefik.http.routers.${PREFIX}-traefik.service=api@internal | |||||
| - traefik.http.routers.${PREFIX}-traefik.tls=true | |||||
| ports: | |||||
| - "${TRAEFIK_LISTENING_IP}:80:80" | |||||
| - "${TRAEFIK_LISTENING_IP}:443:443" | |||||
| volumes: | volumes: | ||||
| - web:/var/www/html | |||||
| - wp-cli-cache:/var/www/.wp-cli | |||||
| - /etc/localtime:/etc/localtime:ro | |||||
| - /var/run/docker.sock:/var/run/docker.sock:ro | |||||
| - traefik-certs:/certs:ro | |||||
| - traefik-dynamic:/etc/traefik/dynamic:ro | |||||
| - traefik-logs:/logs | |||||
| - traefik-static:/etc/traefik/static:ro | |||||
| version: "3.4" | version: "3.4" | ||||
| volumes: | volumes: | ||||
| db: | db: | ||||
| name: ${DOCKER_PREFIX}-db | |||||
| web: | |||||
| name: ${DOCKER_PREFIX}-web | |||||
| name: ${PREFIX}-db | |||||
| traefik-certs: | |||||
| name: ${PREFIX}-traefik-certs | |||||
| traefik-dynamic: | |||||
| name: ${PREFIX}-traefik-dynamic | |||||
| traefik-logs: | |||||
| name: ${PREFIX}-traefik-logs | |||||
| traefik-static: | |||||
| name: ${PREFIX}-traefik-static | |||||
| webroot: | |||||
| name: ${PREFIX}-webroot | |||||
| wp-cli-cache: | wp-cli-cache: | ||||
| name: wp-cli-cache | name: wp-cli-cache |