Skip to content

Instantly share code, notes, and snippets.

@terrillo
Created November 5, 2021 22:29
Show Gist options
  • Save terrillo/63fd83bff0616a21a5d676cc9ae6a5f9 to your computer and use it in GitHub Desktop.
Save terrillo/63fd83bff0616a21a5d676cc9ae6a5f9 to your computer and use it in GitHub Desktop.
wordpress-5.8.1
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
## Timezone Data
RUN echo "tzdata tzdata/Areas select Europe" > /tmp/preseed.txt; \
echo "tzdata tzdata/Zones/Europe select Berlin" >> /tmp/preseed.txt; \
debconf-set-selections /tmp/preseed.txt && \
apt-get update && \
apt-get install -y tzdata
# Dependencies
RUN apt-get update -y
RUN apt-get install curl unzip apache2 ghostscript -y
RUN apt-get install php php-mysql libapache2-mod-php php-bcmath php-curl php-imagick php-intl php-json php-mbstring php-xml php-zip -y
# Configure apache
RUN a2ensite 000-default
RUN a2enmod rewrite
RUN chown -R www-data:www-data /var/www
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_RUN_DIR /var/www/html
COPY ./server/000-default.conf /etc/apache2/sites-available/000-default.conf
RUN /etc/init.d/apache2 start
# Download Wordpress
WORKDIR /var
RUN curl https://wordpress.org/wordpress-5.8.1.zip -o wordpress.zip
RUN unzip wordpress -d www
RUN rm -rf /var/www/html
RUN mv /var/www/wordpress /var/www/html
# COPY FILES
RUN rm -rf /var/www/html/wp-content/plugins/*
COPY ./html/wp-content/themes /var/www/html/wp-content/themes
COPY ./html/wp-content/uploads /var/www/html/wp-content/uploads
COPY ./html/wp-content/plugins/visitorkit-wordpress /var/www/html/wp-content/plugins/visitorkit-wordpress
COPY ./html/wp-config.php /var/www/html/wp-config.php
COPY ./html/.htaccess /var/www/html/.htaccess
COPY ./composer.json /var/www/html/composer.json
# Composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN cd /var/www/html && composer update
EXPOSE 80
# Start Apache
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment