Skip to content

Instantly share code, notes, and snippets.

@emcniece
Last active January 7, 2019 04:54
Show Gist options
  • Save emcniece/4a1258ef68bed7f2e4980c16fcde4c09 to your computer and use it in GitHub Desktop.
Save emcniece/4a1258ef68bed7f2e4980c16fcde4c09 to your computer and use it in GitHub Desktop.
Simple WordPress Docker Stack
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
#!/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