Skip to content

Instantly share code, notes, and snippets.

@ohlulu
Created May 2, 2020 06:14
Show Gist options
  • Save ohlulu/5e6be74c1880072c2ebeb13aa3e03b29 to your computer and use it in GitHub Desktop.
Save ohlulu/5e6be74c1880072c2ebeb13aa3e03b29 to your computer and use it in GitHub Desktop.
docker-compose (wordpress+mysql)
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 80:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- /wordpress/html:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- /wordpress/mysqldb:/var/lib/mysql
volumes:
wordpress:
db:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment