Ubuntu 20.04
My PHP version that is linked to docker image mautic/mautic:v4 :
My MySQL/MariaDB version is powertic/percona-docker
I try to install mautic behind a reverse Traefik proxy with docker-compose. The configuration works well for the portainer container. The configuration even worked with Mautic before.
However, lately I am getting a ‘Gateway timeout’. If I activate MAUTIC_TRUSTED_PROXIES I am getting a 404.
version: '3.3'
services:
traefik:
container_name: traefik
image: 'traefik:latest'
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --log.level=DEBUG
- --certificatesresolvers.leresolver.acme.httpchallenge=true
- --certificatesresolvers.leresolver.acme.email=${EMAIL}
- --certificatesresolvers.leresolver.acme.storage=/etc/traefik/acme.json
- --certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=web
ports:
- '80:80'
- '443:443'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- ./traefik:/etc/traefik
labels:
- 'traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)'
- 'traefik.http.routers.http-catchall.entrypoints=web'
- 'traefik.http.routers.http-catchall.middlewares=redirect-to-https'
- 'traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https'
portainer:
image: portainer/portainer-ce:2.6.3
command: -H unix:///var/run/docker.sock
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.frontend.rule=Host(`containers.${SITE}`)'
- 'traefik.http.routers.frontend.entrypoints=websecure'
- 'traefik.http.services.frontend.loadbalancer.server.port=9000'
- 'traefik.http.routers.frontend.service=frontend'
- 'traefik.http.routers.frontend.tls.certresolver=leresolver'
mautic-app:
image: mautic/mautic:v4
restart: always
volumes:
- mautic_data:/var/www/html
environment:
- MAUTIC_DB_HOST=mautic-database
- MAUTIC_DB_USER=${MAUTIC_DB_USER}
- MAUTIC_DB_PASSWORD=${MAUTIC_DB_PASSWORD}
- MAUTIC_DB_NAME=mautic
#- MAUTIC_TRUSTED_PROXIES=0.0.0.0/0
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.marketing.rule=Host(`mautic.${SITE}`)'
- 'traefik.http.routers.marketing.entrypoints=websecure'
- 'traefik.http.services.marketing.loadbalancer.server.port=80'
- 'traefik.http.routers.marketing.service=marketing'
- 'traefik.http.routers.marketing.tls.certresolver=leresolver'
depends_on:
- mautic-database
networks:
- mautic-net
mautic-database:
image: powertic/percona-docker
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MAUTIC_DB_PASSWORD}
volumes:
- database:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --sql-mode=""
networks:
- mautic-net
volumes:
portainer_data:
driver: local
database:
driver: local
mautic_data:
driver: local
networks:
mautic-net:
driver: bridge