Created
January 5, 2018 21:12
-
-
Save uchilaka/77db0b4740daa2beb368909de3628608 to your computer and use it in GitHub Desktop.
Wordpress In Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
db: | |
container_name: wp-mysql | |
ports: | |
- 8086:3306 | |
image: mysql/mysql-server:5.7 | |
restart: unless-stopped | |
environment: | |
MYSQL_DATABASE: uc-wordpress | |
MYSQL_ROOT_PASSWORD: y0ur-password | |
volumes: | |
- ./data/db/mysql:/var/lib/mysql | |
- ./conf.d:/etc/mysql/conf.d | |
# NOTE ON NETWORKING | |
# be aware that network subnets can either be maintained outside of your compose script, or within - but if within, will need to NOT co-incide with other compose scripts deploying to the same docker engine | |
# you can even get as specific as assigning IP addresses within the virutal network spun up by the Docker Engine to run your containers | |
# networks: | |
# vmnet: | |
# ipv4_address: 4.11.0.3 | |
wp: | |
container_name: uc-wordpress | |
environment: | |
WORDPRESS_DB_NAME: uc-wordpress | |
WORDPRESS_DB_HOST: db:3306 | |
# create these credentials manually after the initialization of the database i.e. 'crud'@'%' via `docker exec...` | |
WORDPRESS_DB_USER: crud | |
WORDPRESS_DB_PASSWORD: an0ther-password | |
ports: | |
- 7310:80 | |
restart: unless-stopped | |
image: uchilaka/uc-wordpress:dev | |
build: | |
context: . | |
volumes: | |
# - ./data/wordpress-dev:/var/www/html | |
- ./data/wordpress:/var/www/html | |
depends_on: | |
- db | |
# command: ["/usr/shared/app/node_modules/wait-for-it/wait-for-it.sh", "db:3306", "--", "apache2-foreground"] | |
# networks: | |
# vmnet: | |
# ipv4_address: 4.11.0.11 | |
# networks: | |
# vmnet: | |
# driver: bridge | |
# ipam: | |
# config: | |
# - subnet: 4.11.0.0/16 | |
# gateway: 4.11.0.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment