Skip to content

Instantly share code, notes, and snippets.

@yusufusta
Created September 20, 2024 09:40
Show Gist options
  • Save yusufusta/98c02c785131adf22babe82817b4cfaf to your computer and use it in GitHub Desktop.
Save yusufusta/98c02c785131adf22babe82817b4cfaf to your computer and use it in GitHub Desktop.
My docker compose config for WordPress
domain.com {
reverse_proxy wordpress:80
}
pma.domain.com {
reverse_proxy phpmyadmin:80
}
version: '3.8'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- wordpress_data:/var/www/html
phpmyadmin:
depends_on:
- db
ports:
- "8080:80"
image: phpmyadmin/phpmyadmin:latest
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: wordpress
caddy:
image: caddy:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
db_data: {}
wordpress_data: {}
caddy_data: {}
caddy_config: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment