Skip to content

Conversation

@hannes-lehmann
Copy link
Contributor

Fix Docker Compose Configuration Issues

This PR addresses several Docker best practices violations and configuration issues in the all-in-one Docker setup.

Fixes

Changes Made

🔒 Security & Configuration

  • Replaced tracked .env with .env.example - Prevents accidental exposure of credentials in version control
  • Added .env to .gitignore - Users now copy .env.example to .env and configure their own keys
  • Moved database credentials to environment variables - Supports customization via .env file
  • Added missing env variables - APP_EMAIL_LOGO_URL and APP_EMAIL_LOGO_LINK_URL to eliminate startup warnings

🐳 Docker Best Practices

  • Pinned image versions - Changed from latest to specific versions:
    • redis:7-alpine (was redis:latest)
    • postgres:16-alpine (was postgres:latest)
  • Removed explicit container names - Prevents conflicts when running multiple instances
  • Removed unnecessary port exposure - Redis no longer exposes port 6379 to host (only needed internally)
  • Removed custom network definition - Uses Docker Compose's default network
  • Simplified volume definitions - Removed redundant driver: local (default behavior)
  • Added restart policies - All services now have restart: unless-stopped

🔧 Improvements

  • Database connection uses env vars - DATABASE_URL now references POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB
  • Default values for all env vars - Falls back to sensible defaults if not specified

Migration Guide

Users upgrading should:

  1. Copy .env.example to .env
  2. Generate new APP_KEY and JWT_SECRET as documented in the README
  3. Customize any other values as needed

Testing

  • ✅ Successfully starts all services
  • ✅ Database migrations run correctly
  • ✅ Application accessible at http://localhost:8123
  • ✅ No container name conflicts with other projects
  • ✅ Reproducible deployments with pinned versions

This commit addresses several Docker best practices violations and
configuration issues in the all-in-one Docker setup.

Changes:
- Pin image versions (redis:7-alpine, postgres:16-alpine)
- Remove explicit container names to prevent conflicts
- Remove unnecessary Redis port exposure
- Add restart policies for all services
- Replace tracked .env with .env.example
- Move database credentials to environment variables
- Add missing env variables (APP_EMAIL_LOGO_URL, APP_EMAIL_LOGO_LINK_URL)
- Simplify network and volume definitions

Probably closes HiEventsDev#880
References HiEventsDev#877
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@hannes-lehmann
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@daveearley
Copy link
Contributor

Thanks you very much for this, @hannes-lehmann!

@daveearley daveearley merged commit a99eefe into HiEventsDev:develop Nov 27, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Error running local development with solution

2 participants