See full article.
FROM wordpress:latest
RUN apt-get update && \
apt-get -y install net-tools vim cron
ADD src/php.ini /usr/local/etc/php/php.ini
RUN curl https://dl.eff.org/certbot-auto -O && \
mv certbot-auto /usr/local/bin/certbot-auto && \
chown root /usr/local/bin/certbot-auto && \
chmod 0755 /usr/local/bin/certbot-auto
ADD src/get-initial-cert.sh /usr/local/bin/get-initial-cert.sh
RUN chown root /usr/local/bin/get-initial-cert.sh && \
chmod 0755 /usr/local/bin/get-initial-cert.sh
ADD src/renew-cert.sh /usr/local/bin/renew-cert.sh
RUN chown root /usr/local/bin/renew-cert.sh && \
chmod 0755 /usr/local/bin/renew-cert.sh
ADD src/empty.pem /var/www/html/certs/fullchain.pem
ADD src/empty.pem /var/www/html/certs/privkey.pem
ADD src/ssl-site.conf /etc/apache2/sites-available/ssl-site.conf
RUN a2enmod ssl && a2ensite ssl-site
ADD src/crontab-renew.txt /tmp/crontab-renew.txt
RUN crontab -u root /tmp/crontab-renew.txt