Skip to content

Instantly share code, notes, and snippets.

@elszczepano
Last active July 2, 2023 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elszczepano/5185ed93165acaba857116f3b5950113 to your computer and use it in GitHub Desktop.
Save elszczepano/5185ed93165acaba857116f3b5950113 to your computer and use it in GitHub Desktop.
WordPress dev env example configuration
version: '3.9'
services:
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
env_file: .env
environment:
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
ports:
- '3306:3306'
healthcheck:
test: mysqladmin ping -h localhost -P 3306 -u root -p$$MYSQL_ROOT_PASSWORD
interval: 5s
timeout: 10s
retries: 3
volumes:
- db_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin:5.2.1
restart: always
ports:
- 8080:80
environment:
- PMA_ARBITRARY=1
depends_on:
- db
wordpress:
image: wordpress:6.2.2
volumes:
- $PWD/wp_data:/var/www/html
ports:
- 80:80
restart: always
env_file: .env
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=$MYSQL_USER
- WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD
- WORDPRESS_DB_NAME=$MYSQL_DATABASE
depends_on:
- db
- phpmyadmin
volumes:
db_data:
wp_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment