mautic/docker-mautic

Mautic 5.0.3 FPM docroot issue

elclay7 opened this issue · 2 comments

docker-compose

version: '3'

services:

  mautic-bd:
    image: mariadb:10.5.8
    container_name: mautic-bd
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=rootpass
      - MYSQL_DATABASE=mdb
      - MYSQL_USER=muser
      - MYSQL_PASSWORD=ordipass
      - MYSQL_ALLOW_EMPTY_PASSWORD=no
    expose:
      - 3306
    volumes:
      - /storage01/mautic/db/data:/var/lib/mysql

  mautic-ws:
    image: nginx:1.24-alpine
    container_name: mautic-ws
    restart: unless-stopped
    volumes:
      - /storage01/mautic/ws/default.conf:/etc/nginx/conf.d/default.conf
      - /storage01/mautic/app/html:/var/www/html
    ports:
      - 8088:80

  mautic-web:
    image: mautic/mautic:5.0.3-fpm
    container_name: mautic-web
    restart: unless-stopped
    volumes:
      - /storage01/mautic/app/html:/var/www/html
      - /storage01/mautic/app/cron:/opt/mautic/cron
    expose:
      - 9000
    environment:
      - MAUTIC_DB_HOST=mautic-bd
      - MYSQL_PORT=3306
      - MAUTIC_DB_NAME=mdb
      - MAUTIC_DB_USER=muser
      - MAUTIC_DB_PASSWORD=ordipass
      - MYSQL_ROOT_PASSWORD=rootpass
      - DOCKER_MAUTIC_ROLE=mautic_web
    depends_on:
      - mautic-bd

  mautic-cron:
    image: mautic/mautic:5.0.3-fpm
    container_name: mautic-cron
    restart: unless-stopped
    volumes:
      - /storage01/mautic/app/html:/var/www/html
      - /storage01/mautic/app/cron:/opt/mautic/cron
    environment:
      - MAUTIC_DB_HOST=mautic-bd
      - MYSQL_PORT=3306
      - MAUTIC_DB_NAME=mdb
      - MAUTIC_DB_USER=muser
      - MAUTIC_DB_PASSWORD=ordipass
      - MYSQL_ROOT_PASSWORD=rootpass
      - DOCKER_MAUTIC_ROLE=mautic_cron
    depends_on:
      - mautic-web

  mautic-worker:
    image: mautic/mautic:5.0.3-fpm
    container_name: mautic-worker
    restart: unless-stopped
    volumes:
      - /storage01/mautic/app/html:/var/www/html
      - /storage01/mautic/app/cron:/opt/mautic/cron
    environment:
      - MAUTIC_DB_HOST=mautic-bd
      - MYSQL_PORT=3306
      - MAUTIC_DB_NAME=mdb
      - MAUTIC_DB_USER=muser
      - MAUTIC_DB_PASSWORD=ordipass
      - MYSQL_ROOT_PASSWORD=rootpass
      - DOCKER_MAUTIC_ROLE=mautic_worker
    depends_on:
      - mautic-web

Error
image

[error] 30#30: *1 directory index of "/var/www/html/docroot/" is forbidden, client: 192.168.80.1, server: , request: "GET / HTTP/1.1"

image

What am I doing wrong in my conf?

From what I see there is no index file in the docroot directory, why?

I ran into this same problem, but found if I pointed the mount to another directory (like docroot2), copied the files from the container's docroot to the other directory, and then pointed the mount to docroot, it worked.

The definitive solution is not to use bind mounts and instead use volumes