-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (27 loc) · 1.25 KB
/
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
32
33
34
35
36
37
38
39
40
FROM wordpress:php8.2-apache
# Install required packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl cron nano sendmail-bin sendmail rsyslog
# Download and install WP-CLI
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
RUN mkdir /var/log/php && touch /var/log/php/error.log && chown www-data:www-data /var/log/php/error.log
COPY php/php.ini /usr/local/etc/php/conf.d/php.ini
COPY wordpress/wp-config.php /var/www/wp-config-custom.php
# Overwrite .htaccess
COPY wordpress/.htaccess /var/www/.htaccess
COPY cron/cron.conf /etc/cron.d/wordpress
RUN chmod 600 /etc/cron.d/wordpress
COPY sendmail/sendmail.mc /etc/mail/sendmail.mc
RUN m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
WORKDIR /var/www/html
# Custom entrypoint to install WP & replace wp-config
# As we replace the original entrypoint from wordpress Dockerfile
# we need to run that also in our replacement to actually install
# WordPress and start PHP.
COPY ./entrypoint.sh /custom-entrypoint.sh
RUN chmod +x /custom-entrypoint.sh
ENTRYPOINT ["/custom-entrypoint.sh"]
CMD ["apache2-foreground"]
EXPOSE 80