Skip to content

Instantly share code, notes, and snippets.

@bleft
Created February 17, 2022 07:21
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 bleft/3fbb7ed08983f0338b5d68968da34be5 to your computer and use it in GitHub Desktop.
Save bleft/3fbb7ed08983f0338b5d68968da34be5 to your computer and use it in GitHub Desktop.
Run Wordpress with MySQL in Docker - start with: docker-compose up -d
version: "3.8"
services:
db:
image: mysql:latest
volumes:
- ./db/data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: database
MYSQL_USER: username
MYSQL_PASSWORD: password
wordpress:
image: wordpress:latest
depends_on:
- db
volumes:
- ./wp/wp-content:/var/www/html/wp-content
# Add other files or folders that you want to override here e.g. stylesheets
ports:
- "8880:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: database
WORDPRESS_DB_USER: username
WORDPRESS_DB_PASSWORD: password
WORDPRESS_TABLE_PREFIX: klex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment