Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
Created February 10, 2026 18:17
Show Gist options
  • Select an option

  • Save pjaudiomv/f4eb4e7547eb9a45cf84dab973ec707d to your computer and use it in GitHub Desktop.

Select an option

Save pjaudiomv/f4eb4e7547eb9a45cf84dab973ec707d to your computer and use it in GitHub Desktop.
Wordpress Docker Compose
services:
wordpress:
depends_on:
- db
build: .
restart: always
ports:
- 8080:80
- 7443:443
environment:
WORDPRESS_DEBUG: true
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
# Mount the entire public_html directory as the WordPress root
- ./site:/var/www/html
# Separate logs directory
- ./logs/:/var/log/apache2
db:
image: mariadb:10.11
restart: always
ports:
- 3306:3306
environment:
MARIADB_ROOT_PASSWORD: somewordpress
MARIADB_DATABASE: wordpress
MARIADB_USER: wordpress
MARIADB_PASSWORD: wordpress
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/001-init.sql
- db_data:/var/lib/mysql
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment