Skip to content

feat: docker-compose and docker CI pipeline enhancements#838

Open
AnishSarkar22 wants to merge 50 commits intoMODSetter:devfrom
AnishSarkar22:fix/docker
Open

feat: docker-compose and docker CI pipeline enhancements#838
AnishSarkar22 wants to merge 50 commits intoMODSetter:devfrom
AnishSarkar22:fix/docker

Conversation

@AnishSarkar22
Copy link
Contributor

@AnishSarkar22 AnishSarkar22 commented Feb 25, 2026

Description

  • Added docker-compose.dev.yml which uses local surfsense_web and surfsense_backedand it supports hot reloading.
  • Enhanced the docker build CI pipeline. It now builds two separate images to GHCR, surfsense-web and surfsense-backend.
  • Added script for initialization of electricsql user.
  • Added a script for one line installer. Also adds Watchtower as auto-update containers.
  • Added migrate-database.sh to migrate existing data from the legacy all-in-one container (PostgreSQL 14) to the new PostgreSQL 17
    • Runs automatically via install.sh when the legacy surfsense-data volume is detected.
    • Users can also run it separately with custom PostgreSQL credentials (--db-user, --db-password, --db-name) and a --yes flag (used by install.sh script) to skip confirmation prompts.
  • Added cleaner GHCR Docker image version tags, so each release is available as both a specific build and a simple version tag (for example, 0.0.14.2 and 0.0.14) while keeping latest unchanged.
  • Edited all docs and readme as well to show the new one line install script.
  • Added healthcheck configuration for backend in both docker compose files and update service dependencies to ensure healthy startup.

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR restructures the Docker deployment architecture by splitting the monolithic all-in-one image into separate surfsense-web and surfsense-backend images. The docker-compose configuration has been reorganized into a new docker/ directory with production (docker-compose.yml) and development (docker-compose.dev.yml) variants. The CI pipeline now builds multi-architecture images (amd64/arm64) for both services separately using a matrix strategy. A comprehensive .env.example file and one-line installation script have been added to streamline deployment. The frontend image now uses runtime environment variable substitution instead of build-time values, and the Electric SQL user initialization script has been simplified.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 docker/.env.example
2 docker/docker-compose.yml
3 docker/docker-compose.dev.yml
4 docker/scripts/install.sh
5 docker/scripts/init-electric-user.sh
6 .github/workflows/docker_build.yaml
7 surfsense_web/Dockerfile
8 surfsense_web/docker-entrypoint.sh
9 surfsense_web/docker-entrypoint.js
10 surfsense_backend/alembic/versions/66_add_notifications_table_and_electric_replication.py
11 Dockerfile.allinone
12 docker-compose.quickstart.yml
13 docker-compose.yml

Need help? Join our Discord

Analyzing latest changes...

@vercel
Copy link

vercel bot commented Feb 25, 2026

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 2e99f1e..d7a5486

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (16)

.github/workflows/docker_build.yaml
Dockerfile.allinone
docker-compose.quickstart.yml
docker-compose.yml
docker/.env.example
docker/docker-compose.dev.yml
docker/docker-compose.yml
docker/scripts/init-electric-user.sh
docker/scripts/install.sh
scripts/docker/entrypoint-allinone.sh
scripts/docker/init-postgres.sh
scripts/docker/supervisor-allinone.conf
surfsense_backend/alembic/versions/66_add_notifications_table_and_electric_replication.py
surfsense_web/Dockerfile
surfsense_web/docker-entrypoint.js
surfsense_web/docker-entrypoint.sh

⏭️ Files skipped (1)
  Locations  
docker/postgresql.conf

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on d7a5486..6e2a055

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (8)

.github/workflows/docker_build.yaml
README.md
docker/.env.example
docker/docker-compose.dev.yml
docker/docker-compose.yml
docker/scripts/install.sh
surfsense_web/content/docs/docker-installation.mdx
surfsense_web/content/docs/how-to/electric-sql.mdx

Keeps the deletion of Dockerfile.allinone, docker-compose.yml (root), and
scripts/docker/entrypoint-allinone.sh from fix/docker. Ports the Daytona
sandbox env vars added by upstream/dev into docker/docker-compose.yml and
docker/docker-compose.dev.yml instead.

Made-with: Cursor
…Docker Compose files for cloud code execution
…ata migration process

- Updated install.sh to handle fresh installations and migrations from the legacy all-in-one container.
- Added checks for Docker and Docker Compose prerequisites.
- Implemented a wait-for-postgres function to ensure database readiness.
- Enhanced migration script to extract data and recover SECRET_KEY automatically.
- Updated documentation to reflect the new automated migration process.
…nclude new Docker command and manual update process
…dated steps and options for managing updates
@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review February 26, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant