mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 17:26:23 +02:00
fix: make ZERO_QUERY_URL portable across all environments
- Default to Docker service networking (http://frontend:3000) in both compose files — works when all services run in Docker - Add extra_hosts (host.docker.internal:host-gateway) for cross-platform host access when running frontend outside Docker - Document override examples in .env.example for local dev and custom domain setups
This commit is contained in:
parent
8dd539c384
commit
cab33d9f4c
3 changed files with 13 additions and 1 deletions
|
|
@ -85,6 +85,14 @@ EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
||||||
# ZERO_CVR_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
# ZERO_CVR_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
||||||
# ZERO_CHANGE_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
# ZERO_CHANGE_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
||||||
|
|
||||||
|
# URL where zero-cache sends queries for resolution (server-to-server).
|
||||||
|
# Default: http://frontend:3000/api/zero/query (Docker service networking).
|
||||||
|
# Override when running the frontend outside Docker:
|
||||||
|
# ZERO_QUERY_URL=http://host.docker.internal:3000/api/zero/query
|
||||||
|
# Override for custom domain:
|
||||||
|
# ZERO_QUERY_URL=https://app.yourdomain.com/api/zero/query
|
||||||
|
# ZERO_QUERY_URL=http://frontend:3000/api/zero/query
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Database (defaults work out of the box, change for security)
|
# Database (defaults work out of the box, change for security)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,8 @@ services:
|
||||||
image: rocicorp/zero:0.26.2
|
image: rocicorp/zero:0.26.2
|
||||||
ports:
|
ports:
|
||||||
- "${ZERO_CACHE_PORT:-4848}:4848"
|
- "${ZERO_CACHE_PORT:-4848}:4848"
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -182,7 +184,7 @@ services:
|
||||||
- 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_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_REPLICA_FILE=/data/zero.db
|
||||||
- ZERO_ADMIN_PASSWORD=${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
- ZERO_ADMIN_PASSWORD=${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
||||||
- ZERO_QUERY_URL=${ZERO_QUERY_URL:-http://host.docker.internal:3000/api/zero/query}
|
- ZERO_QUERY_URL=${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
||||||
volumes:
|
volumes:
|
||||||
- zero_cache_data:/data
|
- zero_cache_data:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,8 @@ services:
|
||||||
image: rocicorp/zero:0.26.2
|
image: rocicorp/zero:0.26.2
|
||||||
ports:
|
ports:
|
||||||
- "${ZERO_CACHE_PORT:-5929}:4848"
|
- "${ZERO_CACHE_PORT:-5929}:4848"
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
environment:
|
environment:
|
||||||
ZERO_UPSTREAM_DB: ${ZERO_UPSTREAM_DB:-postgresql://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
|
ZERO_UPSTREAM_DB: ${ZERO_UPSTREAM_DB:-postgresql://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
|
||||||
ZERO_CVR_DB: ${ZERO_CVR_DB:-postgresql://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
|
ZERO_CVR_DB: ${ZERO_CVR_DB:-postgresql://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}?sslmode=${DB_SSLMODE:-disable}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue