Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
63 lines (62 loc) · 3.05 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
63 lines (62 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Build-from-source setup: docker compose -f docker-compose.dev.yml up --build
# For the ready-to-use setup that pulls the pre-built image, use docker-compose.yml
# instead.
#
# Single container: Chrome/Xvfb/x11vnc/noVNC are installed on demand into a
# tmpfs mount the first time a login is triggered, then left in place for the
# rest of this container's life (including across a plain `docker stop`/
# `start`, not just within one "up") so later logins skip straight past that
# ~30-90s setup - see webui/browser_provisioning.py. That means this
# container needs outbound network access (Debian mirrors +
# storage.googleapis.com) the first time a login is triggered, not just at
# image build time. Shutdown itself only stops those processes (no apt
# purge), so Docker's default stop grace period is plenty; if a process ever
# fails to exit cleanly, the Config page (/auth) shows a warning instead.
#
# One volume: everything (Google auth tokens, per-device forwarding config,
# location history, logs) lives flat in one directory, /data in the image's
# default env (see docker/web/Dockerfile), so a single volume mounted there
# covers all of it - no subfolders to keep track of. The on-demand ESP-IDF
# toolchain (~2GB) and firmware-build sandboxes live under /firmware instead
# (webui/config.py's GFMT_FIRMWARE_DIR), deliberately NOT mounted so a
# container replace wipes them and the next build re-provisions automatically.
# Opt in to keeping the toolchain across replaces by uncommenting the
# `firmware:/firmware` mount and `firmware:` volume below; either way stale
# builds and an idle toolchain are auto-reclaimed on startup (main.py).
#
# LAN-only setup by default: plain HTTP (set HTTPS_ENABLED=1 for a
# self-signed cert instead - see README.md's Security section), and no auth
# unless both HTTP_USER and HTTP_PASSWORD are set. See the "Web UI" section
# in README.md before exposing this beyond your own network.
services:
web:
build:
context: .
dockerfile: docker/web/Dockerfile
ports:
- "4321:4321"
# Chrome under Xvfb needs more than Docker's default 64MB /dev/shm, and its
# tmpfs mount needs exec (Docker defaults to noexec, which blocks running the
# extracted Chrome binary with a misleading "Permission denied"). Leave both
# on rather than toggling them off after signing in - the Firmware page's
# on-demand ESP-IDF build also needs this container capable of that kind of
# work, so there's no "done with it" point to comment them back out at.
shm_size: "1g"
tmpfs:
- /run/gfmt-browser:rw,exec,nosuid,size=1g
environment:
# Set both to protect the web UI (and the embedded Chrome login it
# shows) with this username/password. Leave unset only on a fully
# trusted LAN.
- HTTP_USER=${HTTP_USER:-}
- HTTP_PASSWORD=${HTTP_PASSWORD:-}
- SECRETS_ENCRYPTION_KEY=${SECRETS_ENCRYPTION_KEY:-}
- HTTPS_ENABLED=${HTTPS_ENABLED:-}
- GFMT_TLS_SAN=${GFMT_TLS_SAN:-}
volumes:
- data:/data
# - firmware:/firmware
restart: unless-stopped
volumes:
data:
# firmware: