Skip to content

Instantly share code, notes, and snippets.

@hsimah
Created September 6, 2020 20:58
Show Gist options
  • Save hsimah/3f325e0eecb19963d2a2b88cbc9a78d3 to your computer and use it in GitHub Desktop.
Save hsimah/3f325e0eecb19963d2a2b88cbc9a78d3 to your computer and use it in GitHub Desktop.
Node-react Dockerfile for WordPress, WSL2 & Docker
########################################################################
# Pre-configured WordPress Installation for local PHP/node development #
# For development & 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
# 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