Last active
May 4, 2023 03:03
-
-
Save Appleec/e2a158a721c5f959ad7e0814746d3efe 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: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment