Last active
January 7, 2019 04:54
-
-
Save emcniece/4a1258ef68bed7f2e4980c16fcde4c09 to your computer and use it in GitHub Desktop.
Simple WordPress Docker Stack
This file contains 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.1' | |
services: | |
wordpress: | |
image: wordpress | |
restart: always | |
ports: | |
- 8080:80 | |
environment: | |
WORDPRESS_DB_HOST: db | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
WORDPRESS_DB_NAME: wordpress | |
volumes: | |
- ./files:/var/www/html/ | |
db: | |
image: mysql:5.7 | |
restart: always | |
environment: | |
MYSQL_DATABASE: wordpress | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
MYSQL_RANDOM_ROOT_PASSWORD: '1' | |
volumes: | |
- ./mysql:/var/lib/mysql |
This file contains 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
#!/bin/bash | |
# | |
# Simple WordPress Docker Stack | |
# | |
# This stack volumes the wordpress files into the local directory, so you might want to run this in a clean folder. | |
# Directory structure: | |
# | |
# ./files: WordPress core files | |
# ./mysql: Persistent MySQL data | |
mkdir -p my-wp | |
cd my-wp | |
docker-compose up -d | |
docker-compose logs -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment