Last active
January 30, 2019 12:24
-
-
Save b4dnewz/ca6a45cd286d2d95b0fa09de909659d0 to your computer and use it in GitHub Desktop.
An extended WordPress image designed for easy and fast development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: mysql:5.7 | |
restart: always | |
volumes: | |
- db_data:/var/lib/mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
wp: | |
image: codekraft/wordpress-dev | |
restart: always | |
volumes: | |
- ./themes:/var/www/html/wp-content/themes | |
- ./plugins:/var/www/html/wp-content/plugins | |
depends_on: | |
- db | |
ports: | |
- "8080:80" | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
volumes: | |
db_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WordPress Development | |
# An custom container extended with development tools | |
# | |
# Usage: docker build . | |
# docker build --build-arg VERSION=4.9 . | |
# docker build --build-arg USERID=$(id -u) . | |
ARG VERSION=latest | |
FROM wordpress:$VERSION | |
# Update packages list and install less (required from wp-cli) | |
RUN apt update && apt install less | |
# Change server user id to match host | |
ARG USERID=1000 | |
RUN usermod -u $USERID www-data | |
# Download and install wp-cli | |
RUN curl -o /bin/wpcli https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ | |
&& chmod +x /bin/wpcli | |
# Add an alias script to run wpcli as www-data user | |
RUN echo '#! /bin/sh' >> /bin/wp | |
RUN echo 'runuser -u www-data -- wpcli "$@"' >> /bin/wp | |
RUN chmod +x /bin/wp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment