From ae3ed5d2eb76399b462d641274eac9269ea2ba04 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Vanhalle Date: Mon, 14 Aug 2023 15:08:54 +0200 Subject: [PATCH] updates docker-compose (forgot to add it) --- docker-compose.yml | 85 +++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 24 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 13fa4fb..9620a5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,51 +1,88 @@ --- networks: default: - external: - name: ${DOCKER_PREFIX} + name: ${PREFIX} services: 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: - 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: command: --default-authentication-plugin=mysql_native_password - container_name: ${DOCKER_PREFIX}-db + container_name: ${PREFIX}-db environment: - MYSQL_DATABASE: ${DOCKER_PREFIX} + MYSQL_DATABASE: ${DB_NAME} MYSQL_PASSWORD: ${DB_USER_PASSWORD} MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} MYSQL_USER: ${DB_USER} - hostname: ${DOCKER_PREFIX}-db + hostname: ${PREFIX}-db image: mariadb:10.4.6-bionic + ports: + - "${TRAEFIK_LISTENING_IP}:3306:3306" volumes: - 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: - 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: - - 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" volumes: 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: name: wp-cli-cache