Created
August 6, 2019 14:57
-
-
Save trulymittal/6853a61431f6cd708cc2fcfacecefb68 to your computer and use it in GitHub Desktop.
Docker Compose file for Wordpress setup
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: | |
#Database service | |
mysql_db: | |
image: mysql:5.7 | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: some_password_of_ur_choice | |
MYSQL_DATABASE: name_your_wordpress_database | |
MYSQL_USER: wordpress_user | |
MYSQL_PASSWORD: wordpress_user_password | |
volumes: | |
- mysql:/var/lib/mysql | |
#Wordpress (image based on Apache) | |
wordpress: | |
depends_on: | |
- mysql_db | |
image: wordpress:latest | |
restart: always | |
ports: | |
- "8000:80" | |
environment: | |
WORDPRESS_DB_HOST: mysql_db:3306 | |
WORDPRESS_DB_USER: wordpress_user | |
WORDPRESS_DB_PASSWORD: wordpress_user_password | |
WORDPRESS_DB_NAME: name_your_wordpress_database | |
volumes: | |
["./:/var/www/html"] | |
volumes: | |
mysql: {} |
Thank you
😊
@udithanshu provide an absolute path beginning with “/“ like /var/lib/... and NOT like var/lib/...
Thanks a lot @trulymittal Sir
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you