Skip to content

Instantly share code, notes, and snippets.

@apsolut
Last active November 27, 2021 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apsolut/e7e1b4fb626146d385c19dbe7d885408 to your computer and use it in GitHub Desktop.
Save apsolut/e7e1b4fb626146d385c19dbe7d885408 to your computer and use it in GitHub Desktop.
maybe its time for Docker - WordPress local development
#### TRY
### https://gitmemory.cn/repo/nezhar/wordpress-docker-compose/issues/74
###
###
###
###
version: "3.9"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: ENV.ROOT
MYSQL_DATABASE: ENV.DB
MYSQL_USER: ENV.US
MYSQL_PASSWORD: ENV.PW
wordpress:
depends_on:
- db
image: wordpress:latest
volumes:
# WSL and Docker
- wordpress_data:/var/www/html
# WSL and Docker is faster than Docker with custom folder in normal place CD,D:
# - ./www:/var/www/html/
# /www/ is folder in the same root where this.yaml is located
# if neede hosts: 127.0.0.1 YourDomain.dev
hostname: YourDomain.dev
# remember YourDomain.dev:8008
ports:
- "8008:80"
- "443:443"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: ENV.US
WORDPRESS_DB_PASSWORD: ENV.PW
WORDPRESS_DB_NAME: ENV.DB
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- '8080:80'
environment:
UPLOAD_LIMIT: 1G
PMA_HOST: db
MYSQL_ROOT_PASSWORD: ENV.ROOT
volumes:
db_data: {}
wordpress_data: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment