feat: Update Docker setup for refactored Flask architecture #2

Merged
ryan merged 3 commits from docker-refactor-updates into main 2025-08-08 00:00:03 -04:00
Owner

Summary

Updates the Docker configuration to support the complete codebase refactor that implemented Flask best practices with modular
architecture, authentication, and like system.

Changes Made

🏗️ Docker Configuration Updates

  • Updated Dockerfile: Copy new app/ directory structure instead of old templates/
  • Fixed volume paths: Corrected upload directory mapping to app/static/uploads
  • Updated migration service: Use new comprehensive migrate_session_changes.py script
  • Added environment variables: Support for new configuration system
  • Added .dockerignore: Optimized builds by excluding unnecessary files
  • Removed obsolete version: Cleaned up docker-compose.yml for modern Docker

🛠️ Application Fixes

  • Fixed image display: Resolved static file serving issues after refactor
  • Updated upload paths: Proper Flask static folder configuration
  • Changed default dev port: Use 5001 to avoid macOS AirPlay conflicts
  • Reduced Gunicorn workers: Single worker for better stability and resource usage

📚 Documentation

  • Added README_DOCKER.md: Comprehensive Docker usage guide
  • Environment variable docs: Configuration options and examples
  • Migration instructions: Database update procedures

Architecture Changes Supported

  • Flask Application Factory: Modular app creation with blueprints
  • Blueprint Organization: Separated routes (main, auth, pictures)
  • Configuration Management: Environment-based settings
  • Database Models: Abstracted data operations
  • Authentication System: Login/logout with session management
  • Like System: Cookie-based picture likes with database storage
  • Error Handling: Proper error pages and logging

Testing

  • Docker build succeeds
  • Application starts correctly
  • Images display properly
  • Authentication works
  • Like system functional
  • Database migration works
  • Static files served correctly

Deployment

# Quick start
docker compose up --build

# Run migration (first time or after schema changes)
docker compose --profile migrate up migrate

# Access at http://localhost:54321

Breaking Changes

- Volume paths changed: Update any existing deployments to use new paths
- Migration script updated: Use migrate_session_changes.py instead of migrate.py
- Port change: Development server now defaults to 5001

This PR brings the Docker setup fully in line with the refactored Flask application while maintaining all existing functionality and
adding new features.
## Summary Updates the Docker configuration to support the complete codebase refactor that implemented Flask best practices with modular architecture, authentication, and like system. ## Changes Made ### 🏗️ Docker Configuration Updates - **Updated Dockerfile**: Copy new `app/` directory structure instead of old `templates/` - **Fixed volume paths**: Corrected upload directory mapping to `app/static/uploads` - **Updated migration service**: Use new comprehensive `migrate_session_changes.py` script - **Added environment variables**: Support for new configuration system - **Added .dockerignore**: Optimized builds by excluding unnecessary files - **Removed obsolete version**: Cleaned up docker-compose.yml for modern Docker ### 🛠️ Application Fixes - **Fixed image display**: Resolved static file serving issues after refactor - **Updated upload paths**: Proper Flask static folder configuration - **Changed default dev port**: Use 5001 to avoid macOS AirPlay conflicts - **Reduced Gunicorn workers**: Single worker for better stability and resource usage ### 📚 Documentation - **Added README_DOCKER.md**: Comprehensive Docker usage guide - **Environment variable docs**: Configuration options and examples - **Migration instructions**: Database update procedures ## Architecture Changes Supported - ✅ **Flask Application Factory**: Modular app creation with blueprints - ✅ **Blueprint Organization**: Separated routes (main, auth, pictures) - ✅ **Configuration Management**: Environment-based settings - ✅ **Database Models**: Abstracted data operations - ✅ **Authentication System**: Login/logout with session management - ✅ **Like System**: Cookie-based picture likes with database storage - ✅ **Error Handling**: Proper error pages and logging ## Testing - [x] Docker build succeeds - [x] Application starts correctly - [x] Images display properly - [x] Authentication works - [x] Like system functional - [x] Database migration works - [x] Static files served correctly ## Deployment ```bash # Quick start docker compose up --build # Run migration (first time or after schema changes) docker compose --profile migrate up migrate # Access at http://localhost:54321 Breaking Changes - Volume paths changed: Update any existing deployments to use new paths - Migration script updated: Use migrate_session_changes.py instead of migrate.py - Port change: Development server now defaults to 5001 This PR brings the Docker setup fully in line with the refactored Flask application while maintaining all existing functionality and adding new features.
ryan added 2 commits 2025-08-07 23:59:51 -04:00
- Fix upload folder path to be relative to Flask app static folder
- Update app initialization to use proper static folder structure
- Change default development port to 5001 to avoid AirPlay conflicts
- Images now display correctly in both public and admin views

The refactored app now properly serves uploaded images from the
correct static file location.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change from 4 workers to 1 worker in both Dockerfile and docker-compose.yml
- Helps reduce resource usage and connection reset issues
- Better for single-user or low-traffic deployment scenarios

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
ryan added 1 commit 2025-08-07 23:59:59 -04:00
ryan merged commit ed896a2bdf into main 2025-08-08 00:00:03 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/petpicturequeue#2