composer/docker-compose.yml
padriano fc6d15881d fix: drop unreachable 8123 host port mapping for home assistant
On a macvlan network a published port DNATs to the macvlan IP, which the
host cannot reach, so http://<host>:8123 never worked. Remove the dead
mapping; LAN access is direct via http://192.168.1.246:8123 and external
access is via Caddy. Update README LAN URL accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 09:11:33 +01:00

131 lines
3.3 KiB
YAML

services:
duckdns:
image: lscr.io/linuxserver/duckdns:36a2e3a3-ls78
container_name: duckdns
restart: unless-stopped
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
- SUBDOMAINS=${DUCKDNS_SUBDOMAINS}
- TOKEN=${DUCKDNS_TOKEN}
- UPDATE_IP=ipv4
- LOG_FILE=true
volumes:
- /home/padriano/projects/duckdns/config:/config
homeassistant:
image: homeassistant/home-assistant:2026.5.4
container_name: homeassistant
restart: unless-stopped
# No host port mapping for 8123: with the container on a macvlan network,
# a published port DNATs to the macvlan IP, which the host cannot reach.
# LAN access is direct via the macvlan IP (http://192.168.1.246:8123);
# external access is via Caddy (https://ha-padriano.duckdns.org).
networks:
internal:
macvlan_lan:
ipv4_address: 192.168.1.246
depends_on:
- duckdns
environment:
- TZ=${TZ}
volumes:
- /home/padriano/projects/ha/config:/config
healthcheck:
test: ["CMD", "curl", "-fsSL", "http://localhost:8123/manifest.json"]
interval: 30s
timeout: 10s
retries: 5
start_period: 2m
forgejo:
image: codeberg.org/forgejo/forgejo:10
container_name: forgejo
hostname: forgejo
restart: unless-stopped
ports:
- "3000:3000"
- "2222:22"
networks:
- internal
environment:
- USER_UID=${PUID}
- USER_GID=${PGID}
volumes:
- /home/padriano/projects/forgejo:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
caddy:
build: ./caddy
container_name: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- DUCKDNS_TOKEN=${DUCKDNS_TOKEN}
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks:
- internal
depends_on:
- homeassistant
- forgejo
samba:
image: dperson/samba:latest
container_name: samba
hostname: samba
restart: unless-stopped
networks:
macvlan_lan:
ipv4_address: 192.168.1.247
environment:
- USERID=${SAMBA_UID}
- GROUPID=${SAMBA_GID}
- TZ=${TZ}
command: >
-u "${SAMBA_USERNAME};${SAMBA_PASSWORD}"
volumes:
- /home/padriano/share:/share
- /home/padriano/projects/composer/samba/smb.conf:/etc/samba/smb.conf:ro
timemachine:
image: mbentley/timemachine:smb-20260503
container_name: timemachine
hostname: timemachine
restart: unless-stopped
network_mode: host
tmpfs:
- /run/samba
ulimits:
nofile:
soft: 65536
hard: 65536
environment:
- TM_UID=${TM_UID}
- TM_GID=${TM_GID}
- TM_GROUPNAME=${TM_GROUPNAME}
- TM_USERNAME=${TM_USERNAME}
- PASSWORD=${TIMEMACHINE_PASSWORD}
- SET_PERMISSIONS=false
- VOLUME_SIZE_LIMIT=${TIMEMACHINE_VOLUME_LIMIT}
- CUSTOM_SMB_CONF=true
volumes:
- /home/padriano/backup/timemachine:/opt/timemachine
- /home/padriano/projects/composer/timemachine/avahi-daemon.conf:/etc/avahi/avahi-daemon.conf:ro
- /home/padriano/projects/composer/timemachine/smb.conf:/etc/samba/smb.conf:ro
networks:
internal:
driver: bridge
macvlan_lan:
external: true
volumes:
caddy_data:
caddy_config: