-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (23 loc) · 995 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM php:8-apache
RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
RUN echo "RemoteIPHeader X-Forwarded-For" >> /etc/apache2/conf-enabled/remoteip.conf
RUN echo "RemoteIPInternalProxy 172.16.0.0/12" >> /etc/apache2/conf-enabled/remoteip.conf
RUN a2enmod rewrite headers remoteip
RUN docker-php-ext-install pdo_mysql
COPY . /var/www/html
# Mail alerts service configuring
ARG USE_MAIL_ALERTS
RUN if [ "$USE_MAIL_ALERTS" = "true" ]; then \
set -e; \
apt-get update && apt-get install -y msmtp && rm -rf /var/lib/apt/lists/*; \
cp ./msmtprc /etc/msmtprc; \
chmod 640 /etc/msmtprc; \
touch /var/log/msmtp.log; \
chown root:msmtp /etc/msmtprc; \
chown root:msmtp /var/log/msmtp.log; \
echo "sendmail_path = /usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini; \
set +e; \
fi
RUN chmod 777 /var/www/html/assets/img
ENTRYPOINT ["docker-php-entrypoint"]
CMD ["apache2-foreground"]