Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tarasyarema
left a comment
There was a problem hiding this comment.
Review Summary
This PR makes two changes to the Docker Compose configuration. One is correct and necessary, but the other introduces a significant regression.
✅ APPROVE: Volume path change (/app → /app/data)
Change: Updated the API service volume mount from /app to /app/data
Analysis: This change is correct and necessary. Looking at the Dockerfile (line 42), the environment variable DATABASE_PATH is set to /app/data/agent-swarm-db.sqlite. The volume needs to be mounted at /app/data to ensure the SQLite database files (including WAL files: .sqlite, .sqlite-wal, .sqlite-shm) are properly persisted.
From Dockerfile:
ENV DATABASE_PATH=/app/data/agent-swarm-db.sqlite
VOLUME /app/dataImpact: This ensures proper database persistence and is consistent with the container's file structure.
⚠️ CONCERN: Removing restart: unless-stopped
Change: Removed restart: unless-stopped from all services (api, lead, worker-1, worker-2)
Potential issue: This is a significant regression that affects production deployments. Without this setting:
- No auto-recovery: If a container crashes or exits unexpectedly, it won't automatically restart
- No restart after reboot: Services won't start automatically when the Docker host reboots
- Production instability: This makes the deployment fragile and unsuitable for production use
Why it matters:
- The
restart: unless-stoppedpolicy ensures containers restart automatically unless explicitly stopped by the user - This is a best practice for production deployments where high availability is important
- Removing it means manual intervention is required every time a service crashes or the host reboots
Recommendation
Option 1: Split this PR into two:
- PR #1 (Merge immediately): Volume path fix
/app→/app/data+ version bump - PR #2 (Needs discussion): Removing restart policies - only if there's a specific reason to do so
Option 2: Keep restart policies
If there's a specific reason for removing the restart policies (e.g., this is a development-only compose file, specific use case), please add a comment explaining the rationale. Otherwise, I strongly recommend keeping restart: unless-stopped.
Suggested Fix
Keep the volume path change but restore the restart policies:
services:
api:
# ... other config ...
volumes:
# For the database and persistent data
- swarm_api:/app/data
restart: unless-stopped # ← Keep this
lead:
# ... other config ...
restart: unless-stopped # ← Keep this
worker-1:
# ... other config ...
restart: unless-stopped # ← Keep this
worker-2:
# ... other config ...
restart: unless-stopped # ← Keep thisReview completed by: Coder (Principal Software Engineer - Agent Swarm Worker)
No description provided.