Where to find docker-compose/dockerfiles for mailwizz ?

lucmichalski

New Member
Hi guys,

Hope you are all well !

I was wondering where to find resources to bootstrap mailwizz with docker-compose ? or dockerfiles if compose is not available.

Cheers,
Luc Michalski
 
This is the docker-compose.yaml we're using for dev:
YAML:
mailwizz-mailhog:
  image: phpdockerio/mailhog:latest
  container_name: mailwizz-mailhog
  ports:
    - "8025:8025"
    - "1025:1025"

mailwizz-redis:
  image: redis:4.0
  container_name: mailwizz-redis
  ports:
    - "6379:6379"
        
mailwizz-mysql:
  image: mysql:5.5
  container_name: mailwizz-mysql
  environment:
    - MYSQL_ROOT_PASSWORD=mailwizz
    - MYSQL_DATABASE=mailwizz
    - MYSQL_USER=mailwizz
    - MYSQL_PASSWORD=mailwizz
    - MYSQL_PORT=3306
    - MYSQL_HOST=localhost

mailwizz-webserver:
  image: phpdockerio/nginx:latest
  container_name: mailwizz-webserver
  volumes:
      - ../web:/var/www/web
      - ./ssl:/etc/nginx/ssl
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
  ports:
   - "80:80"
   - "443:443"
  links:
   - mailwizz-php

mailwizz-php:
  build: .
  dockerfile: php/Dockerfile
  container_name: mailwizz-php
  volumes:
    - ../web:/var/www/web
  links:
    - mailwizz-mysql
    - mailwizz-mailhog
    - mailwizz-redis
  environment:
      PHP_php5enmod: 'bcmath gd gmp intl ldap mbstring mysqli pcntl pdo_mysql zip'
      PHP__post_max_size:  '128M'
      PHP__upload_max_filesize:  '128M'
      PHP__memory_limit:  '128M'

mailwizz-phpmyadmin:
  image: phpmyadmin/phpmyadmin
  container_name: mailwizz-phpmyadmin
  environment:
    - PMA_ARBITRARY=1
    - PMA_HOST=mailwizz-mysql
  restart: always
  ports:
    - 81:80
  volumes:
    - /sessions
  links:
    - mailwizz-mysql
Maybe it helps you get started.
 
And the dockerfile for mailwizz-php ?
There you go:
YAML:
FROM phpdockerio/php72-fpm:latest
WORKDIR "/var/www/web"

# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive

# Install selected extensions and other stuff
RUN apt-get update \
    && apt-get -y --no-install-recommends install \
    php7.2-mysql php7.2-bcmath php7.2-bz2 php7.2-gd php7.2-gmp php7.2-imap php7.2-intl php7.2-ldap php7.2-tidy \
    php7.2-xsl php7.2-curl php7.2-json php7.2-common php7.2-dev php7.2-mbstring php7.2-zip php7.2-xml \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
 
one more thing, the nginx configuration file is missing,

More globally, is it possible to create a github repository with all the files ?
 
Additionally to the above response:
the nginx configuration file is missing,
NGINX:
server {
    listen 80;
    
    # max upload
    client_max_body_size 108M;

    # keep utf-8
    charset UTF-8;

    # http://serverfault.com/questions/269420/disable-caching-when-serving-static-files-with-nginx-for-development
    sendfile  off;

    access_log /var/log/nginx/access.log;

    root /var/www/web;
    index index.php;

    location / {
         if (!-e $request_filename){
            rewrite ^(/)?api/.*$ /api/index.php;
         }
         if (!-e $request_filename){
            rewrite ^(/)?customer/.*$ /customer/index.php;
         }
         if (!-e $request_filename){
            rewrite ^(/)?backend/.*$ /backend/index.php;
         }
         if (!-e $request_filename){
            rewrite ^(.*)$ /index.php;
         }
         index  index.html index.htm index.php;
     }

    location ~ \.php$ {
        fastcgi_pass mailwizz-php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "error_log=/var/log/nginx/php_errors.log";
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        include fastcgi_params;
    }
}
 
I have setup everyting with docker-compose but I have the following error message:
CDbException
CDbConnection failed to open the DB connection.

Is there any env variables to pass to mailwizz-php ?
 
yup, the install first.


from the docker container:
Code:
docker exec -it mailwizz-php bash
Where you'll use crontab command to add the cron jobs.

I am almost all setup but crontab does not work inside the docker container. How are you doing it internally ? a shell script ?
 
Back
Top