2026-02-24 22:45:37 +05:30
|
|
|
|
# =============================================================================
|
|
|
|
|
|
# SurfSense — Production Docker Compose
|
|
|
|
|
|
# Docs: https://docs.surfsense.com/docs/docker-installation
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
# Usage:
|
|
|
|
|
|
# 1. Copy .env.example to .env and edit the required values
|
|
|
|
|
|
# 2. docker compose up -d
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
name: surfsense
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
db:
|
|
|
|
|
|
image: pgvector/pgvector:pg17
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
|
- ./postgresql.conf:/etc/postgresql/postgresql.conf:ro
|
|
|
|
|
|
environment:
|
2026-02-24 23:41:22 +05:30
|
|
|
|
POSTGRES_USER: ${DB_USER:-surfsense}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-surfsense}
|
2026-02-24 23:41:22 +05:30
|
|
|
|
POSTGRES_DB: ${DB_NAME:-surfsense}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
command: postgres -c config_file=/etc/postgresql/postgresql.conf
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
healthcheck:
|
2026-02-24 23:41:22 +05:30
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-surfsense} -d ${DB_NAME:-surfsense}"]
|
2026-02-24 22:45:37 +05:30
|
|
|
|
interval: 10s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
|
|
|
|
redis:
|
2026-02-27 21:49:42 +05:30
|
|
|
|
image: redis:8-alpine
|
2026-02-24 22:45:37 +05:30
|
|
|
|
volumes:
|
|
|
|
|
|
- redis_data:/data
|
|
|
|
|
|
command: redis-server --appendonly yes
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
|
|
interval: 10s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
2026-03-14 20:25:25 +05:30
|
|
|
|
searxng:
|
2026-03-15 04:05:04 +05:30
|
|
|
|
image: searxng/searxng:2026.3.13-3c1f68c59
|
2026-03-14 20:25:25 +05:30
|
|
|
|
volumes:
|
2026-03-14 20:34:34 +05:30
|
|
|
|
- ./searxng:/etc/searxng
|
2026-03-14 20:25:25 +05:30
|
|
|
|
environment:
|
|
|
|
|
|
SEARXNG_SECRET: ${SEARXNG_SECRET:-surfsense-searxng-secret}
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/healthz"]
|
|
|
|
|
|
interval: 10s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
2026-02-24 22:45:37 +05:30
|
|
|
|
backend:
|
2026-02-27 22:21:44 +05:30
|
|
|
|
image: ghcr.io/modsetter/surfsense-backend:${SURFSENSE_VERSION:-latest}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
ports:
|
2026-03-09 23:08:27 +05:30
|
|
|
|
- "${BACKEND_PORT:-8929}:8000"
|
2026-02-24 22:45:37 +05:30
|
|
|
|
volumes:
|
|
|
|
|
|
- shared_temp:/shared_tmp
|
|
|
|
|
|
env_file:
|
|
|
|
|
|
- .env
|
|
|
|
|
|
environment:
|
2026-02-25 00:15:29 +05:30
|
|
|
|
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}}
|
|
|
|
|
|
CELERY_BROKER_URL: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
CELERY_RESULT_BACKEND: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
REDIS_APP_URL: ${REDIS_URL:-redis://redis:6379/0}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
CELERY_TASK_DEFAULT_QUEUE: surfsense
|
|
|
|
|
|
PYTHONPATH: /app
|
|
|
|
|
|
UVICORN_LOOP: asyncio
|
|
|
|
|
|
UNSTRUCTURED_HAS_PATCHED_LOOP: "1"
|
2026-03-09 23:08:27 +05:30
|
|
|
|
NEXT_FRONTEND_URL: ${NEXT_FRONTEND_URL:-http://localhost:${FRONTEND_PORT:-3929}}
|
2026-03-14 20:25:25 +05:30
|
|
|
|
SEARXNG_DEFAULT_HOST: ${SEARXNG_DEFAULT_HOST:-http://searxng:8080}
|
2026-02-26 14:37:08 +05:30
|
|
|
|
# Daytona Sandbox – uncomment and set credentials to enable cloud code execution
|
|
|
|
|
|
# DAYTONA_SANDBOX_ENABLED: "TRUE"
|
|
|
|
|
|
# DAYTONA_API_KEY: ${DAYTONA_API_KEY:-}
|
|
|
|
|
|
# DAYTONA_API_URL: ${DAYTONA_API_URL:-https://app.daytona.io/api}
|
|
|
|
|
|
# DAYTONA_TARGET: ${DAYTONA_TARGET:-us}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
SERVICE_ROLE: api
|
2026-02-26 18:39:24 +05:30
|
|
|
|
labels:
|
|
|
|
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
2026-02-24 22:45:37 +05:30
|
|
|
|
depends_on:
|
|
|
|
|
|
db:
|
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
redis:
|
|
|
|
|
|
condition: service_healthy
|
2026-03-14 20:25:25 +05:30
|
|
|
|
searxng:
|
|
|
|
|
|
condition: service_healthy
|
2026-02-24 22:45:37 +05:30
|
|
|
|
restart: unless-stopped
|
2026-02-26 20:08:18 +05:30
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
|
|
|
|
interval: 15s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 30
|
|
|
|
|
|
start_period: 200s
|
2026-02-24 22:45:37 +05:30
|
|
|
|
|
2026-02-24 23:07:07 +05:30
|
|
|
|
celery_worker:
|
2026-02-27 22:21:44 +05:30
|
|
|
|
image: ghcr.io/modsetter/surfsense-backend:${SURFSENSE_VERSION:-latest}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
volumes:
|
|
|
|
|
|
- shared_temp:/shared_tmp
|
|
|
|
|
|
env_file:
|
|
|
|
|
|
- .env
|
|
|
|
|
|
environment:
|
2026-02-25 00:15:29 +05:30
|
|
|
|
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}}
|
|
|
|
|
|
CELERY_BROKER_URL: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
CELERY_RESULT_BACKEND: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
REDIS_APP_URL: ${REDIS_URL:-redis://redis:6379/0}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
CELERY_TASK_DEFAULT_QUEUE: surfsense
|
|
|
|
|
|
PYTHONPATH: /app
|
2026-03-14 20:25:25 +05:30
|
|
|
|
SEARXNG_DEFAULT_HOST: ${SEARXNG_DEFAULT_HOST:-http://searxng:8080}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
SERVICE_ROLE: worker
|
|
|
|
|
|
depends_on:
|
|
|
|
|
|
db:
|
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
redis:
|
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
backend:
|
2026-02-26 20:08:18 +05:30
|
|
|
|
condition: service_healthy
|
2026-02-26 18:39:24 +05:30
|
|
|
|
labels:
|
|
|
|
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
2026-02-24 23:07:07 +05:30
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
|
|
celery_beat:
|
2026-02-27 22:21:44 +05:30
|
|
|
|
image: ghcr.io/modsetter/surfsense-backend:${SURFSENSE_VERSION:-latest}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
env_file:
|
|
|
|
|
|
- .env
|
|
|
|
|
|
environment:
|
2026-02-25 00:15:29 +05:30
|
|
|
|
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-surfsense}}
|
|
|
|
|
|
CELERY_BROKER_URL: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
CELERY_RESULT_BACKEND: ${REDIS_URL:-redis://redis:6379/0}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
CELERY_TASK_DEFAULT_QUEUE: surfsense
|
|
|
|
|
|
PYTHONPATH: /app
|
|
|
|
|
|
SERVICE_ROLE: beat
|
|
|
|
|
|
depends_on:
|
|
|
|
|
|
db:
|
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
redis:
|
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
celery_worker:
|
|
|
|
|
|
condition: service_started
|
2026-02-26 18:39:24 +05:30
|
|
|
|
labels:
|
|
|
|
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
2026-02-24 23:07:07 +05:30
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
|
|
# flower:
|
2026-02-27 22:21:44 +05:30
|
|
|
|
# image: ghcr.io/modsetter/surfsense-backend:${SURFSENSE_VERSION:-latest}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
# ports:
|
|
|
|
|
|
# - "${FLOWER_PORT:-5555}:5555"
|
|
|
|
|
|
# env_file:
|
|
|
|
|
|
# - .env
|
|
|
|
|
|
# environment:
|
2026-02-25 00:15:29 +05:30
|
|
|
|
# CELERY_BROKER_URL: ${REDIS_URL:-redis://redis:6379/0}
|
|
|
|
|
|
# CELERY_RESULT_BACKEND: ${REDIS_URL:-redis://redis:6379/0}
|
2026-02-24 23:07:07 +05:30
|
|
|
|
# PYTHONPATH: /app
|
|
|
|
|
|
# command: celery -A app.celery_app flower --port=5555
|
|
|
|
|
|
# depends_on:
|
|
|
|
|
|
# - redis
|
|
|
|
|
|
# - celery_worker
|
|
|
|
|
|
# restart: unless-stopped
|
|
|
|
|
|
|
2026-03-23 18:19:37 +02:00
|
|
|
|
zero-cache:
|
|
|
|
|
|
image: rocicorp/zero:0.26.2
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "${ZERO_CACHE_PORT:-5929}:4848"
|
2026-03-24 15:06:58 +02:00
|
|
|
|
extra_hosts:
|
|
|
|
|
|
- "host.docker.internal:host-gateway"
|
2026-03-23 18:19:37 +02:00
|
|
|
|
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_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_CHANGE_DB: ${ZERO_CHANGE_DB:-postgresql://${DB_USER:-surfsense}:${DB_PASSWORD:-surfsense}@${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}
|
2026-04-01 10:18:51 +02:00
|
|
|
|
ZERO_APP_PUBLICATIONS: ${ZERO_APP_PUBLICATIONS:-zero_publication}
|
|
|
|
|
|
ZERO_NUM_SYNC_WORKERS: ${ZERO_NUM_SYNC_WORKERS:-4}
|
|
|
|
|
|
ZERO_UPSTREAM_MAX_CONNS: ${ZERO_UPSTREAM_MAX_CONNS:-20}
|
|
|
|
|
|
ZERO_CVR_MAX_CONNS: ${ZERO_CVR_MAX_CONNS:-30}
|
2026-03-23 20:58:42 +02:00
|
|
|
|
ZERO_QUERY_URL: ${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
2026-03-24 16:25:13 +02:00
|
|
|
|
ZERO_MUTATE_URL: ${ZERO_MUTATE_URL:-http://frontend:3000/api/zero/mutate}
|
2026-03-23 18:19:37 +02:00
|
|
|
|
volumes:
|
|
|
|
|
|
- zero_cache_data:/data
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
depends_on:
|
2026-04-01 10:18:51 +02:00
|
|
|
|
backend:
|
2026-03-23 18:19:37 +02:00
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:4848/keepalive"]
|
|
|
|
|
|
interval: 10s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
2026-02-24 22:45:37 +05:30
|
|
|
|
frontend:
|
2026-02-27 22:21:44 +05:30
|
|
|
|
image: ghcr.io/modsetter/surfsense-web:${SURFSENSE_VERSION:-latest}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
ports:
|
2026-03-09 23:08:27 +05:30
|
|
|
|
- "${FRONTEND_PORT:-3929}:3000"
|
2026-02-24 22:45:37 +05:30
|
|
|
|
environment:
|
2026-03-09 23:08:27 +05:30
|
|
|
|
NEXT_PUBLIC_FASTAPI_BACKEND_URL: ${NEXT_PUBLIC_FASTAPI_BACKEND_URL:-http://localhost:${BACKEND_PORT:-8929}}
|
2026-03-23 18:19:37 +02:00
|
|
|
|
NEXT_PUBLIC_ZERO_CACHE_URL: ${NEXT_PUBLIC_ZERO_CACHE_URL:-http://localhost:${ZERO_CACHE_PORT:-5929}}
|
2026-02-24 22:45:37 +05:30
|
|
|
|
NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE: ${AUTH_TYPE:-LOCAL}
|
|
|
|
|
|
NEXT_PUBLIC_ETL_SERVICE: ${ETL_SERVICE:-DOCLING}
|
|
|
|
|
|
NEXT_PUBLIC_DEPLOYMENT_MODE: ${DEPLOYMENT_MODE:-self-hosted}
|
2026-02-26 18:39:24 +05:30
|
|
|
|
labels:
|
|
|
|
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
2026-02-24 22:45:37 +05:30
|
|
|
|
depends_on:
|
2026-02-26 20:08:18 +05:30
|
|
|
|
backend:
|
|
|
|
|
|
condition: service_healthy
|
2026-03-23 18:19:37 +02:00
|
|
|
|
zero-cache:
|
|
|
|
|
|
condition: service_healthy
|
2026-02-24 22:45:37 +05:30
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
postgres_data:
|
2026-02-26 10:23:38 +05:30
|
|
|
|
name: surfsense-postgres
|
2026-02-24 22:45:37 +05:30
|
|
|
|
redis_data:
|
2026-02-26 10:23:38 +05:30
|
|
|
|
name: surfsense-redis
|
2026-02-24 22:45:37 +05:30
|
|
|
|
shared_temp:
|
2026-02-26 10:23:38 +05:30
|
|
|
|
name: surfsense-shared-temp
|
2026-03-23 18:19:37 +02:00
|
|
|
|
zero_cache_data:
|
|
|
|
|
|
name: surfsense-zero-cache
|