# Windshift Production Docker Compose Configuration # # Quick Start: # 1. Run ./init.sh to generate .env file with SSO_SECRET # 2. Edit .env and set DOMAIN to your hostname # 3. Run: docker compose up -d # # For PostgreSQL: Uncomment the postgres service and related environment variables # For Traefik: Uncomment the traefik service and labels on windshift service services: windshift: image: ghcr.io/windshiftapp/windshift:latest container_name: windshift # Each live item-detail viewer holds an SSE connection (WI-484); the default # 1024 fd limit is the failure point near ~1000 concurrent streams. ulimits: nofile: soft: 65536 hard: 65536 ports: - "${PORT:-8080}:8080" environment: - BASE_URL=https://${DOMAIN} - PORT=8080 - USE_PROXY=true - SSO_SECRET=${SSO_SECRET} - SESSION_IP_BINDING=${SESSION_IP_BINDING:-log} - ATTACHMENT_PATH=/data/attachments # OPTIONAL: S3-compatible attachment storage. Leave STORAGE_BACKEND=local # to keep attachments on the /data/attachments volume. - STORAGE_BACKEND=${STORAGE_BACKEND:-local} - S3_ENDPOINT=${S3_ENDPOINT:-} - S3_BUCKET=${S3_BUCKET:-} - S3_REGION=${S3_REGION:-} - S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID:-} - S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY:-} - S3_FORCE_PATH_STYLE=${S3_FORCE_PATH_STYLE:-false} - S3_PREFIX=${S3_PREFIX:-} - DB_PATH=/data/windshift.db - LOG_LEVEL=info - LOG_FORMAT=json # OPTIONAL: accept self-signed certificates for outbound TLS connections # (SMTP, IMAP, LDAP, HTTPS integrations). This disables server identity # verification; leave false unless every destination network is trusted. - TLS_SKIP_VERIFY=${TLS_SKIP_VERIFY:-false} # Total process budget. Keep the container limit below in sync. - WINDSHIFT_MEMORY_LIMIT_MB=${WINDSHIFT_MEMORY_LIMIT_MB:-2048} - DISABLE_PLUGINS=${DISABLE_PLUGINS:-false} - PLUGIN_DIR=/data/plugins - ENABLE_ADMIN_FALLBACK=${ENABLE_ADMIN_FALLBACK:-false} # Temp directories for SQLite in scratch containers - TMPDIR=/tmp - SQLITE_TMPDIR=/tmp # --- Web Push (VAPID) for mobile/PWA push notifications --- # OPTIONAL: leave unset and the server auto-generates a keypair on first # boot and persists it in the database — push works with no setup. Set # these only to manage/rotate keys yourself (keep the pair stable; # rotating invalidates every existing subscription): # npx web-push generate-vapid-keys # then put them in .env - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY:-} - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY:-} # Optional VAPID "sub" contact (mailto: or https:). Defaults to BASE_URL. - VAPID_SUBJECT=${VAPID_SUBJECT:-} # Optional bearer token for the Prometheus /metrics endpoint. When set, # scrapers must send "Authorization: Bearer "; when unset, the # endpoint is public and should be restricted at the reverse proxy. - WINDSHIFT_METRICS_TOKEN=${WINDSHIFT_METRICS_TOKEN:-} # --- PostgreSQL (uncomment when using postgres service) --- # - DB_TYPE=postgres # - POSTGRES_HOST=postgres # - POSTGRES_PORT=5432 # - POSTGRES_USER=windshift # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} # - POSTGRES_DB=windshift # - POSTGRES_SSLMODE=disable # PostgreSQL connection budget: # replicas × (MAX_READ_CONNS + 5 when SSH is enabled) + headroom # must not exceed PostgreSQL max_connections. Windshift validates this # declared budget at startup and exposes it in Admin → Diagnostics. # - MAX_READ_CONNS=30 # - POSTGRES_REPLICA_COUNT=1 # - POSTGRES_CONNECTION_HEADROOM=10 # --- LLM (uncomment when using llm service) --- # - LLM_ENDPOINT=http://llm:8081 # --- Coding agents (uncomment the windshift-runner service + coding-agent # network below). Windshift orchestrates only — it queues runs and # serves the runner pool; agents execute on the windshift-runner host, # never here. Enable the feature with --enable-coding-agent / # CODING_AGENT_ENABLED=true. The in-network URL lets the runner reach # Windshift over the internal egress network: --- # - CODING_AGENT_ENABLED=true # - CODING_AGENT_WS_API_URL=http://windshift:8080/api volumes: - windshift-data:/data # tmpfs for /tmp - the scratch image has no /tmp. Needed for SQLite WAL # mode. Short syntax on purpose - the long-syntax "mode: 1777" is parsed as # DECIMAL (mounts as 03361); the short form defaults to a correct sticky # 1777. tmpfs: - /tmp:exec,size=64M restart: unless-stopped mem_limit: ${WINDSHIFT_CONTAINER_MEMORY_LIMIT:-2g} # --- Traefik labels (uncomment when using traefik service) --- # labels: # - "traefik.enable=true" # - "traefik.http.routers.windshift.rule=Host(`${DOMAIN}`)" # - "traefik.http.routers.windshift.entrypoints=websecure" # - "traefik.http.routers.windshift.tls.certresolver=letsencrypt" # - "traefik.http.services.windshift.loadbalancer.server.port=8080" # --- Networks: keep ONE list with every network windshift joins. Listing # any network here removes the implicit default — keep "default". --- # networks: # - default # - traefik # with the traefik service # - coding-agent # with a coding-agent flavor (internal egress network) depends_on: [] # --- PostgreSQL dependency (uncomment when using postgres service) --- # postgres: # condition: service_healthy # --- LLM dependency (uncomment when using llm service) --- # llm: # condition: service_healthy # --------------------------------------------------------------------------- # Coding-agent runner (uncomment to run coding-agent jobs on this host) # --------------------------------------------------------------------------- # Co-locates the windshift-runner worker with Windshift so the whole # coding-agent stack lives in this one compose file. Agent containers are # spawned into the coding-agent network declared at the bottom; because that # network is INTERNAL, agents and the runner can reach only Windshift — # no host firewall / egress-allowlist rules are needed (LLM and git traffic # is brokered through Windshift's proxies). # # When using the runner: # 1. Uncomment this service, the coding-agent network at the bottom, and # on the windshift service above: the networks list and # CODING_AGENT_WS_API_URL=http://windshift:8080/api # 2. Start Windshift, mint a pool registration token (Admin -> Runner # Pools), set it in .env as WSRUNNER_REGISTRATION_TOKEN # 3. docker compose up -d # --------------------------------------------------------------------------- # windshift-runner: # image: ghcr.io/windshiftapp/windshift-runner:latest # container_name: windshift-runner # environment: # # In-compose control plane. Plaintext HTTP is acceptable only because # # the traffic never leaves this host's docker bridge. # WS_API_URL: http://windshift:8080/api # WSRUNNER_ALLOW_INSECURE: "1" # WSRUNNER_REGISTRATION_TOKEN: ${WSRUNNER_REGISTRATION_TOKEN} # WSRUNNER_IMAGE: ghcr.io/windshiftapp/windshift-agent:latest # volumes: # # Drive the host docker daemon (spawns the sandboxed agent containers). # - /var/run/docker.sock:/var/run/docker.sock # # SAME path on host and in-container: the host daemon — not this # # container — bind-mounts each prepared checkout into the agent # # container, so the path must resolve identically on the host. # - /var/lib/windshift-runner:/var/lib/windshift-runner # networks: # - coding-agent # depends_on: # - windshift # restart: unless-stopped # --------------------------------------------------------------------------- # PostgreSQL (uncomment to use instead of SQLite) # --------------------------------------------------------------------------- # When using PostgreSQL: # 1. Uncomment this service # 2. Uncomment the DB_* environment variables in windshift service above # 3. Uncomment the depends_on section in windshift service # 4. Set POSTGRES_PASSWORD in your .env file # 5. Uncomment postgres-data volume below # --------------------------------------------------------------------------- # postgres: # image: postgres:18 # container_name: windshift-postgres # environment: # POSTGRES_USER: windshift # POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # POSTGRES_DB: windshift # volumes: # - postgres-data:/var/lib/postgresql/data # restart: unless-stopped # healthcheck: # test: ["CMD-SHELL", "pg_isready -U windshift -d windshift"] # interval: 5s # timeout: 5s # retries: 5 # --------------------------------------------------------------------------- # Traefik Reverse Proxy (uncomment for built-in HTTPS with Let's Encrypt) # --------------------------------------------------------------------------- # When using Traefik: # 1. Uncomment this service # 2. Uncomment the labels and networks in windshift service above # 3. Set TRAEFIK_HOST and LETSENCRYPT_EMAIL in your .env file # 4. Uncomment the traefik network below # 5. Remove or comment out the ports section in windshift service # --------------------------------------------------------------------------- # traefik: # image: traefik:v3.0 # container_name: windshift-traefik # command: # - "--api.dashboard=false" # - "--providers.docker=true" # - "--providers.docker.exposedbydefault=false" # - "--entrypoints.web.address=:80" # - "--entrypoints.web.http.redirections.entrypoint.to=websecure" # - "--entrypoints.web.http.redirections.entrypoint.scheme=https" # - "--entrypoints.websecure.address=:443" # - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" # - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" # - "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}" # - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" # ports: # - "80:80" # - "443:443" # volumes: # - "/var/run/docker.sock:/var/run/docker.sock:ro" # - "traefik-certs:/letsencrypt" # restart: unless-stopped # networks: # - traefik # --------------------------------------------------------------------------- # Local LLM Inference (uncomment for AI features like "Plan My Day") # --------------------------------------------------------------------------- # When using the LLM service: # 1. Uncomment this service # 2. Uncomment the LLM_ENDPOINT environment variable in windshift service above # 3. Uncomment the depends_on llm section in windshift service # Note: Container needs ~2 GB RAM (1.25 GB model + KV cache + overhead) # --------------------------------------------------------------------------- # llm: # build: # context: .. # dockerfile: deploy/Dockerfile.llm # # image: ghcr.io/windshiftapp/llm:latest # container_name: windshift-llm # environment: # LLM_PORT: 8081 # LLM_CTX_SIZE: 4096 # LLM_THREADS: ${LLM_THREADS:-4} # LLM_PARALLEL: 2 # restart: unless-stopped # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:8081/health"] # interval: 15s # timeout: 5s # retries: 3 # start_period: 120s volumes: windshift-data: name: windshift-data # --- PostgreSQL volume (uncomment when using postgres service) --- # postgres-data: # name: windshift-postgres-data # --- Traefik certificates volume (uncomment when using traefik service) --- # traefik-certs: # name: windshift-traefik-certs # --- Networks: keep ONE top-level networks block; uncomment the entries you # use. --- # Traefik network: uncomment with the traefik service. # Coding-agent egress network: uncomment with either coding-agent flavor. The # fixed name matches the network agent containers are spawned into. # "internal: true" is the whole egress story: containers on it reach each # other (i.e. Windshift) but nothing else — it replaces the firewalld / # iptables allowlist in deploy/coding-agent/README.md. # networks: # traefik: # name: windshift-traefik # coding-agent: # name: coding-agent-egress # internal: true