Skip to content

Instantly share code, notes, and snippets.

@hsimah
Last active September 6, 2020 20:57
Show Gist options
  • Save hsimah/55652cd10d380ecd67307ca56444d329 to your computer and use it in GitHub Desktop.
Save hsimah/55652cd10d380ecd67307ca56444d329 to your computer and use it in GitHub Desktop.
Node-ready docker-compose.yml for WordPress, WSL2 & Docker
version: "3.7"
services:
wordpress:
container_name: www
build:
context: .
dockerfile: ./Dockerfile
links:
- mysql
env_file:
- .env
volumes:
- .docker/wp-content:/var/www/html/wp-content:delegated
- .:/var/www/html/wp-content/plugins/my-plugin:delegated
- type: volume
source: node_modules
target: /var/www/html/wp-content/plugins/my-plugin/app/node_modules
volume:
nocopy: true
- type: tmpfs
target: /var/www/html/wp-content/plugins/my-plugin/.docker
volume:
nocopy: true
tmpfs:
size: 0
mysql:
container_name: db
image: mysql:5.7
env_file:
- .env
volumes:
- database:/var/lib/mysql
volumes:
database:
node_modules:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment