Skip to content

Instantly share code, notes, and snippets.

@trulymittal
Created August 6, 2019 14:57
Show Gist options
  • Save trulymittal/6853a61431f6cd708cc2fcfacecefb68 to your computer and use it in GitHub Desktop.
Save trulymittal/6853a61431f6cd708cc2fcfacecefb68 to your computer and use it in GitHub Desktop.
Docker Compose file for Wordpress setup
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: {}
@trulymittal
Copy link
Author

Thank you

😊

@trulymittal
Copy link
Author

@udithanshu provide an absolute path beginning with “/“ like /var/lib/... and NOT like var/lib/...

@ashutosh887
Copy link

Thanks a lot @trulymittal Sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment