wordpress/Dockerfile
2023-05-26 16:44:54 +10:00

30 lines
1.0 KiB
Docker

# NAME leenooks/wordpress
# VERSION 5.9-fpm
FROM wordpress:5.9-fpm-alpine
# Change to http respositories, so they we can cache the install packages
RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi
# Tune PHP
RUN sed -e 's/^expose_php = On/expose_php = Off/' /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini
RUN sed -i -e 's#^;sendmail_path =#sendmail_path = "/usr/bin/msmtp -t"#' /usr/local/etc/php/php.ini
RUN adduser -g "Hosting Admin User" -u 1000 -G www-data -h /var/www/html -HD lamp && mkdir /run/nginx
# Base
RUN apk add --no-cache unzip zlib nginx msmtp
RUN curl -SLo /usr/local/bin/wait-for-it https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh && chmod +x /usr/local/bin/wait-for-it
COPY msmtprc /etc/
COPY docker/www.conf /usr/local/etc/php-fpm.d/
COPY docker/nginx-app.conf /etc/nginx/http.d/default.conf
COPY docker/init /sbin/
COPY update /usr/local/sbin
RUN chmod 550 /sbin/init && chown 0:0 /sbin/init
WORKDIR /var/www/html
EXPOSE 80
ENTRYPOINT [ "/sbin/init" ]
CMD [ "php-fpm" ]