140 lines
3.9 KiB
YAML
140 lines
3.9 KiB
YAML
name: homegate
|
|
services:
|
|
homegate:
|
|
build: .
|
|
image: homegate:0.6.0
|
|
restart: unless-stopped
|
|
init: true
|
|
user: "${LOCAL_UID:-1000}:${LOCAL_GID:-1000}"
|
|
environment:
|
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
PYTHONUNBUFFERED: "1"
|
|
HOMEGATE_CONFIG: /config/services.yaml
|
|
HOMEGATE_STATE: /data
|
|
HOMEGATE_CONTROL: /control
|
|
NPM_URL: "${NPM_URL:?Set NPM_URL in .env}"
|
|
NPM_IDENTITY: "${NPM_IDENTITY:?Set NPM_IDENTITY in .env}"
|
|
NPM_PASSWORD_FILE: /run/secrets/npm_password
|
|
PIHOLE_URL: "${PIHOLE_URL:-}"
|
|
PIHOLE_PASSWORD_FILE: /run/secrets/pihole_password
|
|
# Optional PEM bundle for HTTPS management APIs; never disable verification.
|
|
API_CA_BUNDLE: "${API_CA_BUNDLE:-}"
|
|
volumes:
|
|
- ./config:/config:ro
|
|
- ./state:/data
|
|
- ./control:/control
|
|
secrets:
|
|
- npm_password
|
|
- pihole_password
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m
|
|
cap_drop: [ALL]
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
pids_limit: 64
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
healthcheck:
|
|
test: [CMD, python, /app/homegate.py, health]
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 120s
|
|
retries: 3
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 5m
|
|
max-file: "3"
|
|
# No ports, Docker socket or host networking required.
|
|
|
|
ssh-export:
|
|
build: .
|
|
image: homegate:0.6.0
|
|
command: [serve]
|
|
restart: unless-stopped
|
|
init: true
|
|
user: "${LOCAL_UID:-1000}:${LOCAL_GID:-1000}"
|
|
environment:
|
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
PYTHONUNBUFFERED: "1"
|
|
HOMEGATE_CONFIG: /config/services.yaml
|
|
SSH_BIND_IP: "${SSH_BIND_IP:?Set the Homegate host LAN IP in .env}"
|
|
ports:
|
|
- "${SSH_BIND_IP:?Set SSH_BIND_IP}:${SSH_PORT:-8099}:8080"
|
|
volumes:
|
|
- ./config:/config:ro
|
|
# This service has NO CA state, API passwords or Docker socket.
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m
|
|
cap_drop: [ALL]
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
pids_limit: 64
|
|
mem_limit: 128m
|
|
cpus: 0.5
|
|
healthcheck:
|
|
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=3).read()"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 5m
|
|
max-file: "3"
|
|
|
|
ui:
|
|
build: .
|
|
image: homegate:0.6.0
|
|
entrypoint: [python, /app/homegate_ui.py]
|
|
command: []
|
|
restart: unless-stopped
|
|
init: true
|
|
user: "${LOCAL_UID:-1000}:${LOCAL_GID:-1000}"
|
|
environment:
|
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
PYTHONUNBUFFERED: "1"
|
|
HOMEGATE_CONFIG: /config/services.yaml
|
|
HOMEGATE_CONTROL: /control
|
|
UI_BIND_IP: "${UI_BIND_IP:?Set the Homegate host LAN IP}"
|
|
UI_ORIGIN: "${UI_ORIGIN:?Set the exact panel URL in .env}"
|
|
UI_PASSWORD_FILE: /run/secrets/ui_password
|
|
SSH_PUBLIC_URL: "http://${SSH_BIND_IP}:${SSH_PORT:-8099}/ssh-config"
|
|
ports:
|
|
- "${UI_BIND_IP:?Set UI_BIND_IP}:${UI_PORT:-8098}:8081"
|
|
volumes:
|
|
- ./config:/config
|
|
- ./control:/control
|
|
secrets:
|
|
- ui_password
|
|
# No CA private keys, NPM/Pi-hole passwords or Docker socket in the UI.
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m
|
|
cap_drop: [ALL]
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
pids_limit: 64
|
|
mem_limit: 128m
|
|
cpus: 0.5
|
|
healthcheck:
|
|
test: [CMD, python, -c, "import os,urllib.request,urllib.parse; r=urllib.request.Request('http://127.0.0.1:8081/',headers={'Host':urllib.parse.urlsplit(os.environ['UI_ORIGIN']).netloc}); urllib.request.urlopen(r,timeout=3).read()"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 5m
|
|
max-file: "3"
|
|
|
|
secrets:
|
|
ui_password:
|
|
file: ./secrets/ui_password
|
|
npm_password:
|
|
file: ./secrets/npm_password
|
|
pihole_password:
|
|
file: ./secrets/pihole_password
|