fix: use Traefik labels instead of Caddy — update deploy stack for Contabo
- docker-compose.yml: Traefik routers/services labels, TLS via letsencrypt certresolver - deploy.sh: auto-detects Traefik network, installs plugins from GitHub raw URLs - Containers: ummah2-db, ummah2-wp (apache variant for simpler setup), ummah2-wpcli
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
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: ummah-db
|
||||
container_name: ummah2-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: ummah_wp
|
||||
MYSQL_USER: ummah_wp
|
||||
MYSQL_DATABASE: ummah2_wp
|
||||
MYSQL_USER: ummah2_wp
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
volumes:
|
||||
- ummah-db-data:/var/lib/mysql
|
||||
- ummah2-db-data:/var/lib/mysql
|
||||
networks:
|
||||
- ummah-net
|
||||
- ummah2-internal
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
interval: 10s
|
||||
@@ -21,66 +25,69 @@ services:
|
||||
retries: 5
|
||||
|
||||
wordpress:
|
||||
image: wordpress:6.7-php8.3-fpm-alpine
|
||||
container_name: ummah-wp
|
||||
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: ummah_wp
|
||||
WORDPRESS_DB_USER: ummah_wp
|
||||
WORDPRESS_DB_NAME: ummah2_wp
|
||||
WORDPRESS_DB_USER: ummah2_wp
|
||||
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
|
||||
WORDPRESS_TABLE_PREFIX: wp_
|
||||
WORDPRESS_DEBUG: "false"
|
||||
# Performance
|
||||
PHP_MEMORY_LIMIT: 256M
|
||||
PHP_MAX_EXECUTION_TIME: 300
|
||||
PHP_UPLOAD_MAX_FILESIZE: 64M
|
||||
PHP_POST_MAX_SIZE: 64M
|
||||
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:
|
||||
- ummah-wp-data:/var/www/html
|
||||
- ./wordpress-config/php.ini:/usr/local/etc/php/conf.d/ummah.ini:ro
|
||||
- ummah2-wp-data:/var/www/html
|
||||
- ./wordpress-config/php.ini:/usr/local/etc/php/conf.d/ummah2.ini:ro
|
||||
networks:
|
||||
- ummah-net
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: ummah-nginx
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- wordpress
|
||||
ports:
|
||||
- "8888:80"
|
||||
volumes:
|
||||
- ummah-wp-data:/var/www/html:ro
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
networks:
|
||||
- ummah-net
|
||||
- ummah2-internal
|
||||
- traefik-public
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "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"
|
||||
# Redirect http→https
|
||||
- "traefik.http.routers.ummah2-http.rule=Host(`ummah2.falahos.my`)"
|
||||
- "traefik.http.routers.ummah2-http.entrypoints=web"
|
||||
- "traefik.http.routers.ummah2-http.middlewares=https-redirect"
|
||||
|
||||
wpcli:
|
||||
image: wordpress:cli-2-php8.3
|
||||
container_name: ummah-wpcli
|
||||
container_name: ummah2-wpcli
|
||||
depends_on:
|
||||
- wordpress
|
||||
- db
|
||||
user: "33:33"
|
||||
environment:
|
||||
WORDPRESS_DB_HOST: db:3306
|
||||
WORDPRESS_DB_NAME: ummah_wp
|
||||
WORDPRESS_DB_USER: ummah_wp
|
||||
WORDPRESS_DB_NAME: ummah2_wp
|
||||
WORDPRESS_DB_USER: ummah2_wp
|
||||
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
|
||||
volumes:
|
||||
- ummah-wp-data:/var/www/html
|
||||
- ummah2-wp-data:/var/www/html
|
||||
networks:
|
||||
- ummah-net
|
||||
- ummah2-internal
|
||||
entrypoint: ["tail", "-f", "/dev/null"]
|
||||
profiles: ["tools"]
|
||||
|
||||
networks:
|
||||
ummah-net:
|
||||
ummah2-internal:
|
||||
driver: bridge
|
||||
traefik-public:
|
||||
external: true
|
||||
name: ${TRAEFIK_NETWORK:-traefik-public}
|
||||
|
||||
volumes:
|
||||
ummah-db-data:
|
||||
ummah-wp-data:
|
||||
ummah2-db-data:
|
||||
ummah2-wp-data:
|
||||
|
||||
Reference in New Issue
Block a user