server-dotfiles/diary/docker-compose.yml

103 lines
2.1 KiB
YAML

services:
mock:
image: nginx:alpine
restart: unless-stopped
env_file:
- .env
networks:
- proxy
reverse_proxy:
image: caddy:alpine
restart: unless-stopped
network_mode: service:tailscale
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- /srv/docker/reverse_proxy/certs/diary.lan.poldebra.me/fullchain.pem:/cert.crt:ro
- /srv/docker/reverse_proxy/certs/diary.lan.poldebra.me/key.pem:/key.key:ro
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "https://diary.lan.poldebra.me"]
interval: 5s
timeout: 10s
retries: 3
depends_on:
app:
condition: service_started
tailscale:
condition: service_healthy
app:
image: monica:4-apache
depends_on:
db:
condition: service_started
tailscale:
condition: service_healthy
env_file:
- .monica.env
volumes:
- data:/var/www/html/storage
restart: unless-stopped
cron:
image: monica:4-apache
env_file: .monica.env
restart: unless-stopped
volumes:
- data:/var/www/html/storage
command: cron.sh
depends_on:
- app
db:
image: mysql:8.0
env_file:
- .mysql.env
volumes:
- mysql:/var/lib/mysql
restart: unless-stopped
tailscale:
hostname: diary
image: tailscale/tailscale:latest
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "tailscale status"]
interval: 1s
timeout: 5s
retries: 60
volumes:
- tailscale:/var/lib
- /lib/modules:/lib/modules:ro
devices:
- /dev/net/tun:/dev/net/tun
cap_add:
- net_admin
- sys_module
- net_raw
command: tailscaled
volumes:
data:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/diary/data"
mysql:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/diary/mysql"
tailscale:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/diary/tailscale"
networks:
proxy:
external: true