feat: add Zero infra — docker-compose, env vars, Dockerfile, CI workflows

- Add zero-cache service to docker-compose.yml and docker-compose.dev.yml
- Add ZERO_* env vars to docker/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL to surfsense_web/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL placeholder ARG/ENV to Dockerfile
- Add NEXT_PUBLIC_ZERO_CACHE_URL runtime substitution to docker-entrypoint.js
- Add NEXT_PUBLIC_ZERO_CACHE_URL build arg to docker-build.yml and desktop-release.yml
This commit is contained in:
CREDO23 2026-03-23 18:27:18 +02:00
parent 61610106f4
commit f9ba7e52d9
7 changed files with 47 additions and 0 deletions

View file

@ -169,6 +169,28 @@ services:
# - redis
# - celery_worker
zero-cache:
image: rocicorp/zero:0.26.2
ports:
- "${ZERO_CACHE_PORT:-4848}:4848"
depends_on:
db:
condition: service_healthy
environment:
- ZERO_UPSTREAM_DB=${ZERO_UPSTREAM_DB:-postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
- ZERO_CVR_DB=${ZERO_CVR_DB:-postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
- ZERO_CHANGE_DB=${ZERO_CHANGE_DB:-postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
- ZERO_REPLICA_FILE=/data/zero.db
- ZERO_ADMIN_PASSWORD=${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
volumes:
- zero_cache_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4848/keepalive"]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ../surfsense_web
@ -176,6 +198,7 @@ services:
NEXT_PUBLIC_FASTAPI_BACKEND_URL: ${NEXT_PUBLIC_FASTAPI_BACKEND_URL:-http://localhost:8000}
NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE: ${NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE:-LOCAL}
NEXT_PUBLIC_ETL_SERVICE: ${NEXT_PUBLIC_ETL_SERVICE:-DOCLING}
NEXT_PUBLIC_ZERO_CACHE_URL: ${NEXT_PUBLIC_ZERO_CACHE_URL:-http://localhost:${ZERO_CACHE_PORT:-4848}}
NEXT_PUBLIC_DEPLOYMENT_MODE: ${NEXT_PUBLIC_DEPLOYMENT_MODE:-self-hosted}
ports:
- "${FRONTEND_PORT:-3000}:3000"
@ -184,6 +207,8 @@ services:
depends_on:
backend:
condition: service_healthy
zero-cache:
condition: service_healthy
volumes:
postgres_data:
@ -194,3 +219,5 @@ volumes:
name: surfsense-dev-redis
shared_temp:
name: surfsense-dev-shared-temp
zero_cache_data:
name: surfsense-dev-zero-cache