diff --git a/.env.example b/.env.example index 74b25fbef..b1be8d4be 100644 --- a/.env.example +++ b/.env.example @@ -6,9 +6,10 @@ FLOWER_PORT=5555 # Frontend Configuration FRONTEND_PORT=3000 -NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 (Default: http://localhost:8000) -NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL or GOOGLE (Default: LOCAL) -NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING (Default: DOCLING) +NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 +NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL +NEXT_PUBLIC_ETL_SERVICE=DOCLING +NEXT_PUBLIC_ELECTRIC_URL=http://localhost:5133 # Backend Configuration BACKEND_PORT=8000 @@ -19,6 +20,16 @@ POSTGRES_PASSWORD=postgres POSTGRES_DB=surfsense POSTGRES_PORT=5432 +# Electric-SQL Configuration +ELECTRIC_PORT=5133 +# PostgreSQL host for Electric connection +# - 'db' for Docker PostgreSQL (service name in docker-compose) +# - 'host.docker.internal' for local PostgreSQL (recommended when Electric runs in Docker) +# Note: host.docker.internal works on Docker Desktop (Mac/Windows) and can be enabled on Linux +POSTGRES_HOST=db +ELECTRIC_DB_USER=electric +ELECTRIC_DB_PASSWORD=electric_password + # pgAdmin Configuration PGADMIN_PORT=5050 PGADMIN_DEFAULT_EMAIL=admin@surfsense.com diff --git a/docker-compose.yml b/docker-compose.yml index 47486ff40..6ffb1c1dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -118,11 +118,11 @@ services: ports: - "${ELECTRIC_PORT:-5133}:3000" environment: - - DATABASE_URL=postgresql://electric:electric_password@db:5432/${POSTGRES_DB:-surfsense}?sslmode=disable + - DATABASE_URL=${ELECTRIC_DATABASE_URL:-postgresql://${ELECTRIC_DB_USER:-electric}:${ELECTRIC_DB_PASSWORD:-electric_password}@${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-surfsense}?sslmode=disable} - ELECTRIC_INSECURE=true - ELECTRIC_WRITE_TO_PG_MODE=direct - depends_on: - - db + # depends_on: + # - db restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/v1/health"]