From 1c8ed7af6f2c5b77bd059d757052ab11f424c289 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 25 Jan 2023 08:48:44 +0100 Subject: [PATCH] Fix the docker integration of MailHog and fine tune the Dockerfile --- docker-compose.yml | 12 +++++++----- docker/php-fpm/Dockerfile | 10 ++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b2023639..686d6656 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: - '.:/var/www/html' - './docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf' ports: - - '3000:80' + - '8000:80' mysql: image: 'mysql:8.0' @@ -28,17 +28,19 @@ services: - MYSQL_USER=easyappointments - MYSQL_PASSWORD=secret ports: - - '3001:3306' + - '8001:3306' phpmyadmin: image: 'phpmyadmin:5.2.0' restart: always ports: - - '3002:80' + - '8002:80' environment: - - 'PMA_ARBITRARY=1' + - 'PMA_HOST=mysql' mailhog: image: 'mailhog/mailhog:v1.0.1' + restart: always ports: - - '3003:8025' + - '8003:8025' + - '1025:1025' diff --git a/docker/php-fpm/Dockerfile b/docker/php-fpm/Dockerfile index 5e9b682f..5a6425ff 100644 --- a/docker/php-fpm/Dockerfile +++ b/docker/php-fpm/Dockerfile @@ -8,13 +8,19 @@ RUN apt-get update \ zip \ unzip \ && curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s \ - curl gd intl ldap mbstring mysqli odbc pdo soap sockets xml zip xdebug \ + curl gd intl ldap mbstring mysqli odbc pdo pdo_mysql soap sockets xml zip xdebug \ + && docker-php-ext-enable xdebug \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ && curl -sLS https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs \ && npm install -g npm \ + && apt-get install -q -y ssmtp mailutils \ + && echo "hostname=localhost.localdomain" > /etc/ssmtp/ssmtp.conf \ + && echo "root=root@presta.com" >> /etc/ssmtp/ssmtp.conf \ + && echo "mailhub=mailhog:1025" >> /etc/ssmtp/ssmtp.conf \ + && echo "sendmail_path=/usr/sbin/ssmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini \ && apt-get -y autoremove \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* CMD ["bash", "docker/php-fpm/start-container"]