Last active
April 14, 2018 21:14
-
-
Save jbenner-radham/384ddd25d564d50e744e1454c43a6933 to your computer and use it in GitHub Desktop.
Docker based WordPress dev environment lab.
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
| # EditorConfig is awesome: http://EditorConfig.org | |
| # Top-most EditorConfig file. | |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| indent_size = 4 | |
| indent_style = space | |
| insert_final_newline = true | |
| max_line_length = 120 | |
| trim_trailing_whitespace = true | |
| [*.yml] | |
| indent_size = 2 | |
| indent_style = space |
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
| MYSQL_ROOT_PASSWORD=password | |
| MYSQL_DATABASE=wordpress | |
| MYSQL_USER=wordpress | |
| MYSQL_PASSWORD=password | |
| WORDPRESS_DB_HOST=db:3306 | |
| WORDPRESS_DB_USER=wordpress | |
| WORDPRESS_DB_PASSWORD=password |
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.3' | |
| services: | |
| db: | |
| image: mariadb:latest | |
| volumes: | |
| - db_data:/var/lib/mysql | |
| restart: always | |
| environment: | |
| MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" | |
| MYSQL_DATABASE: "${MYSQL_DATABASE}" | |
| MYSQL_USER: "${MYSQL_USER}" | |
| MYSQL_PASSWORD: "${MYSQL_PASSWORD}" | |
| wordpress: | |
| depends_on: | |
| - db | |
| build: . | |
| volumes: | |
| - ./dev-theme:/var/www/html/wp-content/themes/dev-theme | |
| ports: | |
| - "8000:80" | |
| restart: always | |
| environment: | |
| WORDPRESS_DB_HOST: "${WORDPRESS_DB_HOST}" | |
| WORDPRESS_DB_USER: "${WORDPRESS_DB_USER}" | |
| WORDPRESS_DB_PASSWORD: "${WORDPRESS_DB_PASSWORD}" | |
| 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
| FROM wordpress:latest | |
| RUN apt-get update && \ | |
| apt-get install -y git zlib1g-dev && \ | |
| docker-php-ext-install zip | |
| RUN cd /tmp && \ | |
| curl -O https://composer.github.io/installer.sig && \ | |
| curl https://getcomposer.org/installer --output "composer-setup.php" && \ | |
| echo "$(cat installer.sig) composer-setup.php" | sha384sum -c - && \ | |
| php ./composer-setup.php --filename=composer --install-dir=/usr/local/bin && \ | |
| rm ./composer-setup.php && \ | |
| mkdir -p /home/www-data/.composer && \ | |
| chown -R www-data:www-data /home/www-data | |
| USER www-data | |
| ENV COMPOSER_HOME "/home/www-data/.composer" | |
| # `composer global config bin-dir --absolute` | |
| ENV PATH "/home/www-data/.composer/vendor/bin:$PATH" | |
| RUN composer global require wp-cli/wp-cli | |
| RUN composer --version && \ | |
| wp --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment