Fix the docker integration of MailHog and fine tune the Dockerfile

This commit is contained in:
Alex Tselegidis 2023-01-25 08:48:44 +01:00
parent 7343389f7b
commit 1c8ed7af6f
2 changed files with 15 additions and 7 deletions

View File

@ -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'

View File

@ -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"]