96 lines
2.8 KiB
YAML
96 lines
2.8 KiB
YAML
version: "3.9"
|
|
|
|
# ummah2.falahos.my — WordPress on Contabo
|
|
# Reverse proxy: Traefik (already running)
|
|
# Run: docker compose up -d
|
|
|
|
services:
|
|
db:
|
|
image: mariadb:11
|
|
container_name: ummah2-db
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
|
MYSQL_DATABASE: ummah2_wp
|
|
MYSQL_USER: ummah2_wp
|
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
|
volumes:
|
|
- ummah2-db-data:/var/lib/mysql
|
|
networks:
|
|
- ummah2-internal
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
wordpress:
|
|
image: wordpress:6.7-php8.3-apache
|
|
container_name: ummah2-wp
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
WORDPRESS_DB_HOST: db:3306
|
|
WORDPRESS_DB_NAME: ummah2_wp
|
|
WORDPRESS_DB_USER: ummah2_wp
|
|
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
|
|
WORDPRESS_TABLE_PREFIX: wp_umm_
|
|
WORDPRESS_DEBUG: "false"
|
|
PHP_MEMORY_LIMIT: 256M
|
|
WORDPRESS_CONFIG_EXTRA: |
|
|
define('WP_MEMORY_LIMIT', '256M');
|
|
define('WP_HOME', 'https://ummah2.falahos.my');
|
|
define('WP_SITEURL', 'https://ummah2.falahos.my');
|
|
$$_SERVER['HTTPS'] = 'on';
|
|
define('FORCE_SSL_ADMIN', true);
|
|
volumes:
|
|
- ummah2-wp-data:/var/www/html
|
|
- ./wordpress-config/php.ini:/usr/local/etc/php/conf.d/ummah2.ini:ro
|
|
networks:
|
|
- ummah2-internal
|
|
- traefik-public
|
|
labels:
|
|
- "traefik.enable=true"
|
|
# HTTPS router (Cloudflare terminates SSL, Traefik sees HTTP on websecure)
|
|
- "traefik.http.routers.ummah2.rule=Host(`ummah2.falahos.my`)"
|
|
- "traefik.http.routers.ummah2.entrypoints=websecure"
|
|
- "traefik.http.routers.ummah2.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.ummah2.loadbalancer.server.port=80"
|
|
# HTTP router — no middleware, just pass through (Cloudflare handles redirect)
|
|
- "traefik.http.routers.ummah2-http.rule=Host(`ummah2.falahos.my`)"
|
|
- "traefik.http.routers.ummah2-http.entrypoints=web"
|
|
- "traefik.http.routers.ummah2-http.service=ummah2"
|
|
|
|
wpcli:
|
|
image: wordpress:cli-2-php8.3
|
|
container_name: ummah2-wpcli
|
|
depends_on:
|
|
- wordpress
|
|
- db
|
|
user: "33:33"
|
|
environment:
|
|
WORDPRESS_DB_HOST: db:3306
|
|
WORDPRESS_DB_NAME: ummah2_wp
|
|
WORDPRESS_DB_USER: ummah2_wp
|
|
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
|
|
WORDPRESS_TABLE_PREFIX: wp_umm_
|
|
volumes:
|
|
- ummah2-wp-data:/var/www/html
|
|
networks:
|
|
- ummah2-internal
|
|
entrypoint: ["tail", "-f", "/dev/null"]
|
|
profiles: ["tools"]
|
|
|
|
networks:
|
|
ummah2-internal:
|
|
driver: bridge
|
|
traefik-public:
|
|
external: true
|
|
name: ${TRAEFIK_NETWORK:-traefik-public}
|
|
|
|
volumes:
|
|
ummah2-db-data:
|
|
ummah2-wp-data:
|