Skip to content

Instantly share code, notes, and snippets.

@hsimah
Created September 6, 2020 21:08
Show Gist options
  • Save hsimah/5665825ae7d3436ae95d13a9f019d197 to your computer and use it in GitHub Desktop.
Save hsimah/5665825ae7d3436ae95d13a9f019d197 to your computer and use it in GitHub Desktop.
Final Dockerfile for WordPress, WSL2 & Docker
#####################################################################
# Pre-configured WordPress Installation w/ for rhomboid development #
# For testing only, use in production not recommended. #
#####################################################################
FROM wordpress:latest
LABEL author=hsimah
LABEL author_uri=https://github.com/hsimah-services
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Add nodejs to apt
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
&& apt-get -y install git mariadb-client nodejs-legacy \
&& yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# 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
# Copy local files
COPY .docker/root/.gitconfig /root
COPY .bashrc.docker /root/.bashrc
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment