Skip to content

Instantly share code, notes, and snippets.

@ashhitch
Last active March 19, 2018 10:53
Show Gist options
  • Save ashhitch/49b8e23d15764523eface50438ede43a to your computer and use it in GitHub Desktop.
Save ashhitch/49b8e23d15764523eface50438ede43a to your computer and use it in GitHub Desktop.
Wordpress docker file
version: '3'
services:
wordpress:
depends_on:
- db
image: wordpress:4.9.4
restart: always
volumes:
- ./wp-content:/var/www/html/wp-content
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_TABLE_PREFIX: wp_
ports:
- 80:80 # Expose http and https
- 443:443
domainname: local.testsite.co.uk
networks:
- back
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
ports:
- 4306:3306
networks:
- back
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 8080:80
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: wordpress
networks:
- back
networks:
back:
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment