Skip to content

Instantly share code, notes, and snippets.

@Djuki
Created August 13, 2021 06:47
Show Gist options
  • Save Djuki/a2a4c2a3ca67f7f79eea47603944ac70 to your computer and use it in GitHub Desktop.
Save Djuki/a2a4c2a3ca67f7f79eea47603944ac70 to your computer and use it in GitHub Desktop.
WordPress local development environment with official docker image
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- /home/PATH_TO_LOCAL_WORDPRESS:/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'
ports:
- 3306:3306
volumes:
- db:/var/lib/mysql
volumes:
db:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment