Skip to content

Conversation

@mond-day
Copy link

This commit adds complete Portainer deployment support for Fizzy:

  • docker-compose.portainer.yml: Production-ready stack with MySQL and Fizzy

    • Configured for Traefik reverse proxy with automatic SSL
    • Uses external networks: traefik_public and digital_network
    • Includes health checks and proper dependencies
    • Persistent volumes for database and storage
  • .env.portainer.example: Environment variables template

    • All required variables documented with examples
    • SMTP configuration for email support
    • VAPID keys setup for web push notifications
    • Easy to copy and customize
  • README-PORTAINER.md: Complete deployment guide in Portuguese

    • Step-by-step setup instructions
    • Secret generation commands
    • DNS and SSL configuration
    • Troubleshooting section
    • Backup and update procedures
  • .gitignore: Allow .env*.example files to be committed

The GitHub Actions workflow (publish-image.yml) already publishes images to ghcr.io/basecamp/fizzy automatically on main branch pushes, so no manual Docker builds are needed.

This commit adds complete Portainer deployment support for Fizzy:

- docker-compose.portainer.yml: Production-ready stack with MySQL and Fizzy
  - Configured for Traefik reverse proxy with automatic SSL
  - Uses external networks: traefik_public and digital_network
  - Includes health checks and proper dependencies
  - Persistent volumes for database and storage

- .env.portainer.example: Environment variables template
  - All required variables documented with examples
  - SMTP configuration for email support
  - VAPID keys setup for web push notifications
  - Easy to copy and customize

- README-PORTAINER.md: Complete deployment guide in Portuguese
  - Step-by-step setup instructions
  - Secret generation commands
  - DNS and SSL configuration
  - Troubleshooting section
  - Backup and update procedures

- .gitignore: Allow .env*.example files to be committed

The GitHub Actions workflow (publish-image.yml) already publishes
images to ghcr.io/basecamp/fizzy automatically on main branch pushes,
so no manual Docker builds are needed.
@mond-day mond-day marked this pull request as draft December 26, 2025 17:24
Simplifies the deployment process by eliminating the need to run
the Fizzy container just to generate secrets.

Changes:
- scripts/generate-secrets.sh: Automated secret generator
  - Generates SECRET_KEY_BASE using OpenSSL (no container needed!)
  - Generates VAPID keys for Web Push notifications
  - Optionally creates .env.portainer file automatically
  - User-friendly interactive prompts

- scripts/README.md: Documentation for the scripts

- README-PORTAINER.md: Updated deployment guide
  - Highlights the new easy script-based approach
  - Keeps container-based method as fallback
  - Clarifies which values are mandatory vs optional

- .env.portainer.example: Improved template
  - Added helpful comments pointing to the script
  - Clearer instructions for generating secrets

Before: Users had to download and run the Fizzy container to generate secrets
After: Just run ./scripts/generate-secrets.sh - simple and fast!
Resolves the "Services.fizzy.depends_on must be a list" error by
properly configuring the stack for Docker Swarm mode.

Changes to docker-compose.portainer.yml:
- Remove container_name (not supported in Swarm)
- Change depends_on from condition syntax to simple list
  (Swarm doesn't support service_healthy condition)
- Move restart policies to deploy.restart_policy
- Move Traefik labels to deploy.labels (Swarm requirement)
- Add deploy.replicas configuration
- Change MYSQL_HOST from "fizzy_db" to "tasks.db" (Swarm DNS)
- Add traefik.docker.network label for Swarm mode
- Reorder services (db first, then fizzy)

Changes to README-PORTAINER.md:
- Add warning about Docker Swarm mode requirement
- Add docker swarm init instructions
- Add section explaining Swarm mode benefits
- Document Swarm-specific differences (DNS, labels, etc)
- Add useful Swarm commands (stack services, service logs, scale)

This stack now works correctly with Portainer in Swarm mode with
overlay networks (digital_network and traefik_public).
Simplifies stack to only Fizzy service, connecting to user's
existing MySQL instance instead of deploying its own database.

Changes to docker-compose.portainer.yml:
- Remove db service completely
- Remove fizzy_db_data volume
- Change MYSQL_HOST to use environment variable (default: mysql)
- Make all MySQL connection settings configurable via env vars
- Remove depends_on (no longer needed)

Changes to .env.portainer.example:
- Add MySQL External Database section
- Document MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD
- Add helpful comments for different MySQL deployment scenarios
  (Swarm service, Docker container, remote server)

Changes to README-PORTAINER.md:
- Update prerequisites to mention external MySQL requirement
- Add MySQL configuration section in step 2
- Add important notes about MySQL network and permissions
- Update troubleshooting section:
  - Remove references to fizzy_db service
  - Add comprehensive MySQL connectivity debugging steps
  - Add network configuration help
  - Add MySQL permissions verification
- Update Swarm commands (remove db service logs)

This configuration allows users to:
- Use their existing MySQL instance
- Avoid running duplicate MySQL containers
- Keep database management separate from application
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.

2 participants