2021-11-01 16:42:52 -06:00
|
|
|
# Development containers, these should only be used if you are developing.
|
|
|
|
|
version: '3'
|
|
|
|
|
services:
|
2024-03-06 17:41:04 -07:00
|
|
|
db: # https://github.com/docker-library/docs/tree/master/postgres
|
2021-11-01 16:42:52 -06:00
|
|
|
image: postgres:12
|
|
|
|
|
environment:
|
|
|
|
|
- POSTGRES_DB=wrolpi
|
|
|
|
|
- POSTGRES_PASSWORD=wrolpi
|
|
|
|
|
ports:
|
2022-03-09 15:44:02 -07:00
|
|
|
- "5432:5432"
|
2021-11-01 16:42:52 -06:00
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'pg_isready -U postgres' ]
|
2024-03-06 17:41:04 -07:00
|
|
|
interval: 10s
|
2026-05-03 12:09:12 -06:00
|
|
|
start_period: 30s
|
|
|
|
|
start_interval: 1s
|
2024-04-17 11:25:26 -06:00
|
|
|
volumes:
|
|
|
|
|
- ./pg_data:/var/lib/postgresql/data
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2025-12-11 18:32:55 -07:00
|
|
|
controller: # WROLPi Controller Service
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/controller/Dockerfile
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
2026-04-07 20:01:49 -06:00
|
|
|
- "8080:80"
|
2025-12-11 18:32:55 -07:00
|
|
|
volumes:
|
|
|
|
|
# Controller code (for development hot-reload)
|
|
|
|
|
- ./controller:/app/controller
|
|
|
|
|
# Docker socket for container management
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
|
# Host system info (read-only)
|
|
|
|
|
- /proc:/host/proc:ro
|
|
|
|
|
- /sys:/host/sys:ro
|
2026-03-29 11:00:09 -06:00
|
|
|
# Media directory (needed for Samba share path validation)
|
|
|
|
|
- ${MEDIA_DIRECTORY:-./test}:/media/wrolpi
|
2025-12-11 18:32:55 -07:00
|
|
|
environment:
|
|
|
|
|
- DOCKERIZED=true
|
|
|
|
|
- MEDIA_DIRECTORY=/media/wrolpi
|
|
|
|
|
# Override CMD to enable auto-reload for development
|
2026-04-07 20:01:49 -06:00
|
|
|
command: ["python", "-m", "controller.serve"]
|
2025-12-11 18:32:55 -07:00
|
|
|
healthcheck:
|
2026-04-07 20:01:49 -06:00
|
|
|
test: [ 'CMD-SHELL', 'curl -f http://127.0.0.1:80/api/health || exit 1' ]
|
2025-12-11 18:32:55 -07:00
|
|
|
interval: 30s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
start_period: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
api:
|
|
|
|
|
depends_on:
|
2026-02-20 14:37:58 -07:00
|
|
|
db:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
controller:
|
|
|
|
|
condition: service_started
|
2021-11-01 16:42:52 -06:00
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/api/Dockerfile
|
2026-01-22 18:55:12 -07:00
|
|
|
environment:
|
|
|
|
|
# Sanic 25.x wants 'spawn' but our code uses 'fork' for multiprocessing.
|
|
|
|
|
# This tells Sanic to accept the existing start method.
|
|
|
|
|
- SANIC_START_METHOD_SET=1
|
2021-11-01 16:42:52 -06:00
|
|
|
volumes:
|
|
|
|
|
- './main.py:/opt/wrolpi/main.py'
|
|
|
|
|
- './wrolpi:/opt/wrolpi/wrolpi'
|
|
|
|
|
- './modules:/opt/wrolpi/modules'
|
2024-04-14 13:06:03 -06:00
|
|
|
- './scripts:/opt/wrolpi/scripts'
|
2021-11-01 16:42:52 -06:00
|
|
|
- './test:/opt/wrolpi/test'
|
2022-01-22 19:54:46 -07:00
|
|
|
- './test:/media/wrolpi'
|
2021-11-01 16:42:52 -06:00
|
|
|
- './alembic:/opt/wrolpi/alembic'
|
|
|
|
|
- './alembic.ini:/opt/wrolpi/alembic.ini'
|
|
|
|
|
ports:
|
2025-01-26 12:44:16 -07:00
|
|
|
- ${REACT_APP_API-0.0.0.0:8081}:8081
|
2021-11-01 16:42:52 -06:00
|
|
|
user: '${UID-1000}:${GID-1000}'
|
2024-03-06 17:41:04 -07:00
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:8081/api/echo' ]
|
|
|
|
|
interval: 2m
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-03-06 17:41:04 -07:00
|
|
|
archive: # Python/Sanic wrapper around Singlefile and Readability.
|
2023-04-01 15:50:11 -06:00
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/archive/Dockerfile
|
|
|
|
|
volumes:
|
|
|
|
|
- './docker/archive/main.py:/app/main.py'
|
|
|
|
|
ports:
|
|
|
|
|
- '8083:8080'
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:8080/' ]
|
2024-03-06 17:41:04 -07:00
|
|
|
interval: 2m
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2024-03-06 17:41:04 -07:00
|
|
|
app: # React App
|
2021-11-01 16:42:52 -06:00
|
|
|
depends_on:
|
|
|
|
|
- api
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/app/Dockerfile
|
|
|
|
|
volumes:
|
2021-11-02 10:26:07 -06:00
|
|
|
- './app/public:/app/public'
|
|
|
|
|
- './app/src:/app/src'
|
|
|
|
|
- './app/package.json:/app/package.json'
|
2022-10-26 11:21:03 -06:00
|
|
|
- '.env:/app/.env'
|
2021-11-02 10:26:07 -06:00
|
|
|
command: 'npm run start'
|
2021-11-01 16:42:52 -06:00
|
|
|
stdin_open: true
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:3000' ]
|
2024-03-06 17:41:04 -07:00
|
|
|
interval: 1m
|
2021-11-01 16:42:52 -06:00
|
|
|
user: '${UID-1000}:${GID-1000}'
|
2023-01-31 18:08:07 -07:00
|
|
|
environment:
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
# Force React to use Caddy port to connect to it's websocket.
|
2023-01-31 18:08:07 -07:00
|
|
|
- WDS_SOCKET_PORT=0
|
2021-11-01 16:42:52 -06:00
|
|
|
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
web: # Caddy reverse proxy - handles HTTPS for all services.
|
2021-11-01 16:42:52 -06:00
|
|
|
depends_on:
|
|
|
|
|
- app
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
- zim
|
|
|
|
|
- help
|
2024-06-12 18:44:59 -06:00
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/web/Dockerfile
|
2021-11-01 16:42:52 -06:00
|
|
|
ports:
|
2024-06-12 18:44:59 -06:00
|
|
|
- ${WEB_HOST-0.0.0.0}:${WEB_HTTPS_PORT-8443}:443
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
- '8084:8084'
|
|
|
|
|
- '8085:8085'
|
|
|
|
|
- '8086:8086'
|
2021-11-01 16:42:52 -06:00
|
|
|
volumes:
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
- './docker/web/Caddyfile:/etc/caddy/Caddyfile'
|
|
|
|
|
- './icon.ico:/etc/caddy/favicon.ico'
|
|
|
|
|
- './icon.png:/etc/caddy/icon.png'
|
2021-11-01 16:42:52 -06:00
|
|
|
- './test:/opt/media'
|
2026-03-29 18:58:31 -06:00
|
|
|
- './modules/map/static:/opt/wrolpi/modules/map/static:ro'
|
|
|
|
|
- './blobs:/opt/wrolpi-blobs:ro'
|
Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 12:08:27 -07:00
|
|
|
environment:
|
|
|
|
|
- MEDIA_DIRECTORY=/opt/media
|
|
|
|
|
# Set EXTRA_SANS to include the host's LAN IP in the TLS certificate.
|
|
|
|
|
# Example: EXTRA_SANS=IP:10.0.0.5
|
|
|
|
|
- EXTRA_SANS=${EXTRA_SANS:-}
|
2021-11-01 16:42:52 -06:00
|
|
|
healthcheck:
|
2026-04-07 20:01:49 -06:00
|
|
|
test: [ 'CMD-SHELL', 'wget --spider --no-check-certificate https://127.0.0.1:443 || exit 1' ]
|
2024-03-06 17:41:04 -07:00
|
|
|
interval: 1m
|
2022-03-08 13:26:03 -07:00
|
|
|
|
2024-03-06 17:41:04 -07:00
|
|
|
zim: # kiwix-serve
|
2023-05-29 18:04:03 -06:00
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/zim/Dockerfile
|
|
|
|
|
volumes:
|
|
|
|
|
- './test:/media/wrolpi'
|
2023-08-26 19:37:57 -06:00
|
|
|
- './docker/zim/entrypoint.sh:/entrypoint.sh'
|
2024-06-12 18:44:59 -06:00
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:80' ]
|
|
|
|
|
interval: 1m
|
|
|
|
|
|
2026-03-29 11:00:09 -06:00
|
|
|
samba: # Samba file sharing - started/stopped by the controller based on configured shares.
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/samba/Dockerfile
|
|
|
|
|
restart: "no"
|
|
|
|
|
depends_on:
|
|
|
|
|
controller:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
ports:
|
|
|
|
|
- "445:445"
|
|
|
|
|
volumes:
|
|
|
|
|
- ${MEDIA_DIRECTORY:-./test}:/media/wrolpi
|
|
|
|
|
|
2023-10-15 17:18:33 -06:00
|
|
|
help: # The WROLPi Help documentation.
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: docker/help/Dockerfile
|
|
|
|
|
volumes:
|
|
|
|
|
- './docker/help/wrolpi-help:/opt/wrolpi-help'
|
2024-03-06 17:41:04 -07:00
|
|
|
healthcheck:
|
|
|
|
|
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:8086' ]
|
|
|
|
|
interval: 1m
|