Skip to content

Conversation

madebycm
Copy link

@madebycm madebycm commented Jul 8, 2025

 ____  _     _      _    _      _
/ ___|(_) __| | ___| | _(_) ___| | __
\___ \| |/ _` |/ _ \ |/ / |/ __| |/ /
 ___) | | (_| |  __/   <| | (__|   <
|____/|_|\__,_|\___|_|\_\_|\___|_|\_\

Launching your docker-compose application on your VPS 🚀

Description

As someone who's been deploying increasingly complex applications, I found myself wishing Sidekick could handle my docker-compose setups as elegantly as it handles single Dockerfiles. This PR brings that capability to life, addressing issue #74.

I've implemented comprehensive Docker Compose support while staying true to Sidekick's core philosophy: simplicity without sacrificing power. The implementation seamlessly detects compose files and guides users through deployment with the same straightforward experience they've come to expect.

What I've added:

  • Intelligent Detection: Automatically recognizes docker-compose files and offers a choice when both a Dockerfile and compose file exist.

  • Multi-Service Builds: Efficiently builds only services with build contexts, preserving pre-built images.

  • User-Driven Selection: Rather than making assumptions, asks users to identify which service should receive web traffic.

  • Seamless Integration: Automatically-configures Traefik labels and networks while preserving your compose structure.

  • Environment Flexibility: Handles both array and map formats for environment variables.

  • Zero-Downtime Updates: Deploy new versions without interrupting running services.

Technical Approach

I've designed this to feel native to Sidekick - no new commands or complex configurations. Just run sidekick launch and follow the prompts. The code respects existing patterns while extending capabilities for multi-container architectures.

Backwards Compatibility

Existing Dockerfile deployments continue to work exactly as before. This is purely additive functionality.

I've been using this for my own projects that need compose (Next.js apps with Postgres/Redis, Node services with multiple workers, etc.) and it's been working well enough that I figured others might want it too.

Example Flow

sidekick launch
# Auto-detects docker-compose.yml
# Prompts for service selection if multiple expose ports
# Handles the rest automatically

Hope this helps folks who've been wanting compose support. Happy to make any changes based on feedback.

TODO

Future Enhancements

  • Multi-app support with different ports per domain

    • Currently, Sidekick assumes one main web service per deployment.

    • Docker Compose files often define multiple services exposing different ports (API, admin panel, websockets, etc.).

    • Future versions really should support multiple web services with different domains/subdomains (while maintaining the hassle-free auto-deploy philosophy).

    • Example: api.example.com:3000, app.example.com:3001, admin.example.com:3002.

    • This would require updating Traefik label generation to support multiple routers per deployment.

    • Note: I have a POC of this working internally and would be happy to wrap it up and contribute it as a follow-up PR if this one is accepted.

  • Named volume management

    • Better handling of named volumes across deployments.

    • Volume backup/restore functionality.

- Auto-detect docker-compose.yml files alongside Dockerfile
- Prompt users to choose deployment type when both exist
- Build and deploy services defined in compose files
- Support both array and map environment variable formats
- Handle services with custom build contexts and arguments
- Automatically configure Traefik labels for the main web service
- Enable zero-downtime deployments for compose applications

Closes MightyMoud#74
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