Last active
June 15, 2023 14:24
-
-
Save major/09982711ee064ef3241430bc7e81b620 to your computer and use it in GitHub Desktop.
Caddy + Watchtower + Wordpress + MariaDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example.com { | |
tls major@mhtx.net | |
root * /var/www/html | |
php_fastcgi wordpress:9000 | |
encode gzip | |
file_server | |
@disallowed { | |
path *.sql | |
path /wp-content/uploads/*.php | |
} | |
rewrite @disallowed '/index.php' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: '3.8' | |
services: | |
watchtower: | |
image: docker.io/containrrr/watchtower:latest | |
container_name: watchtower | |
restart: unless-stopped | |
environment: | |
- WATCHTOWER_CLEANUP=true | |
- WATCHTOWER_POLL_INTERVAL=3600 | |
command: | |
- --cleanup | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
privileged: true | |
caddy: | |
image: caddy:latest | |
container_name: caddy | |
depends_on: | |
- wordpress | |
ports: | |
- 80:80 | |
- 443:443 | |
restart: unless-stopped | |
volumes: | |
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:Z | |
- wordpress:/var/www/html | |
- caddy_data:/data | |
- caddy_config:/config | |
wordpress: | |
image: docker.io/library/wordpress:6-fpm | |
container_name: wordpress | |
depends_on: | |
- wordpress-db | |
restart: always | |
environment: | |
WORDPRESS_DB_HOST: wordpress-db | |
WORDPRESS_DB_USER: myuser | |
WORDPRESS_DB_PASSWORD: mypassword | |
WORDPRESS_DB_NAME: mydatabase | |
volumes: | |
- wordpress:/var/www/html | |
wordpress-db: | |
image: docker.io/library/mariadb:11 | |
container_name: wordpress-db | |
restart: always | |
environment: | |
MARIADB_DATABASE: mydatabase | |
MARIADB_USER: myuser | |
MARIADB_PASSWORD: mypassword | |
MARIADB_ROOT_PASSWORD: mypassword | |
volumes: | |
- wordpress-db:/var/lib/mysql | |
volumes: | |
caddy_config: | |
caddy_data: | |
wordpress: | |
wordpress-db: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment