2023-04-10 23:42:21 +02:00
|
|
|
version: '3.7'
|
|
|
|
# https://minhcung.me/how-to-start-wordpress-with-caddy-using-docker-compose-3d31bb9ef88b
|
|
|
|
services:
|
|
|
|
database:
|
|
|
|
image: mariadb:latest
|
|
|
|
container_name: database
|
|
|
|
profiles:
|
|
|
|
- database
|
|
|
|
volumes:
|
|
|
|
- database:/var/lib/mysql:rw
|
|
|
|
restart: always
|
|
|
|
env_file:
|
|
|
|
- env/mariadb.env
|
|
|
|
environment:
|
|
|
|
MYSQL_DATABASE: blog_wp
|
|
|
|
command: '--default-authentication-plugin=mysql_native_password'
|
|
|
|
networks:
|
|
|
|
- blog-network
|
|
|
|
# Wordpress
|
|
|
|
wordpress:
|
|
|
|
depends_on:
|
|
|
|
- database
|
2023-11-25 10:03:44 +01:00
|
|
|
image: wordpress:fpm
|
2023-04-10 23:42:21 +02:00
|
|
|
container_name: wordpress
|
|
|
|
profiles:
|
|
|
|
- wordpress
|
|
|
|
restart: always
|
|
|
|
env_file:
|
|
|
|
- env/wordpress.env
|
|
|
|
volumes:
|
|
|
|
- ./php.ini:/usr/local/etc/php/conf.d/custom.ini:ro
|
|
|
|
- wordpress:/var/www/html:rw
|
|
|
|
networks:
|
|
|
|
- blog-network
|
|
|
|
# Webserver
|
|
|
|
caddy:
|
|
|
|
image: caddy:alpine
|
|
|
|
container_name: webserver
|
|
|
|
profiles:
|
|
|
|
- webserver
|
2023-11-25 10:03:44 +01:00
|
|
|
restart: always
|
2023-04-10 23:42:21 +02:00
|
|
|
ports:
|
|
|
|
- 80:80/tcp
|
|
|
|
- 80:80/udp
|
|
|
|
- 443:443/tcp
|
|
|
|
- 443:443/udp
|
|
|
|
volumes:
|
|
|
|
- wordpress:/var/www/html:rw
|
|
|
|
- caddy_data:/data:rw
|
|
|
|
- caddy_config:/config:rw
|
2023-04-11 23:32:02 +02:00
|
|
|
- ./caddy:/etc/caddy:ro
|
2023-04-10 23:42:21 +02:00
|
|
|
networks:
|
|
|
|
- blog-network
|
2023-11-25 10:03:44 +01:00
|
|
|
adminer:
|
|
|
|
image: adminer:latest
|
|
|
|
container_name: adminer
|
|
|
|
profiles:
|
|
|
|
- adminer
|
|
|
|
restart: always
|
|
|
|
env_file:
|
|
|
|
- env/adminer.env
|
|
|
|
depends_on:
|
|
|
|
- database
|
|
|
|
networks:
|
|
|
|
- blog-network
|
2023-04-10 23:42:21 +02:00
|
|
|
# security_opt:
|
|
|
|
# - no-new-privileges:true
|
|
|
|
# - seccomp:unconfined
|
|
|
|
# - apparmor:unconfined
|
|
|
|
# cap_drop:
|
|
|
|
# - ALL
|
|
|
|
# cap_add:
|
|
|
|
# - CHOWN
|
|
|
|
networks:
|
|
|
|
blog-network:
|
|
|
|
driver: bridge
|
|
|
|
name: blog-network
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
database:
|
|
|
|
name: database
|
|
|
|
wordpress:
|
|
|
|
name: wordpress
|
|
|
|
caddy_data:
|
|
|
|
name: caddy_data
|
|
|
|
caddy_config:
|
|
|
|
name: caddy_config
|