/docker-compose.yml Secret
Last active
January 18, 2021 02:21
Star
You must be signed in to star a gist
Example Docker Compose file that links WordPress container to an already running MySQL container using external links.
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: '3' | |
services: | |
wordpress: | |
image: wordpress:4.9.4-php7.0-apache | |
network_mode: bridge | |
external_links: | |
- db-mysql:db | |
volumes: | |
- "./wp-content/themes:/var/www/html/wp-content/themes" | |
- "./wp-content/plugins:/var/www/html/wp-content/plugins" | |
- "./wp-content/uploads:/var/www/html/wp-content/uploads" | |
- "./.htaccess:/var/www/html/.htaccess" | |
ports: | |
- "8080:80" | |
restart: always | |
container_name: wordpress-dev | |
environment: | |
WORDPRESS_DB_HOST: db:3306 | |
WORDPRESS_DB_NAME: wordpress_dev | |
WORDPRESS_DB_USER: someusername | |
WORDPRESS_DB_PASSWORD: somepassword |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! The gist is really helpful.