Change CMD from multi-line shell form to JSON array exec form for better
signal handling and to follow Docker best practices. Consolidate the command
chain into a single line while maintaining the same functionality (migrate,
collectstatic, runserver).
- Remove redundant inline comments for better readability
- Replace backslash line continuation with bash -c for CMD instruction
- Remove commented out gunicorn configuration line
- Improve CMD formatting using proper bash string syntax
These changes make the dockerfile cleaner and more maintainable while
preserving the same functionality (migrate, collectstatic, runserver).
Replace gunicorn production server with Django's development server
(manage.py runserver) for easier debugging. The gunicorn configuration
has been commented out rather than removed for easy restoration.
**Warning:** This change makes the application unsuitable for production
deployment as runserver is not designed for production use.
Replace uv package manager with standard pip for dependency management.
Switch base image from debian:bookworm-slim to python:3.12-slim to include
Python runtime by default.
Key changes:
- Remove uv installation and configuration
- Use requirements.txt instead of pyproject.toml/uv.lock
- Install dependencies with pip instead of uv sync
- Move collectstatic and migrate from build-time to runtime in CMD
- Simplify gunicorn command invocation
This simplifies the build process and makes the image more portable by
using standard Python tooling. Running migrations and collectstatic at
container startup ensures they execute against the correct database and
storage backend.
- Replace pip with UV for faster dependency installation
- Switch base image from python:3.11-slim to debian:bookworm-slim
- Add SECURE_PROXY_SSL_HEADER for production SSL proxy support
- Optimize Docker layer caching by copying dependency files first
- Move database migration to build time for faster container startup
- Enhance Gunicorn logging with access and error log streams
- Update dependency management from requirements.txt to pyproject.toml
These changes improve build performance, production security, and
container startup time while modernizing the dependency management
workflow.
- Set ALLOWED_HOSTS to accept all hosts for easier local testing
- Update Docker port from 8080 to 8000 (Django default)
- Adjust Gunicorn binding to match new port configuration
This simplifies local development setup by using standard Django
conventions and removing host restrictions. The previous specific
host configuration can be restored for production deployment.
- Replace PostgreSQL with SQLite as default database backend
- Comment out PostgreSQL configuration for potential future use
- Update Docker exposed port from 8000 to 8080
- Update Gunicorn bind address to match new port
This simplifies the deployment setup by removing the PostgreSQL
dependency and aligns the application port with common alternatives
to port 8000.
Update Dockerfile to use port 8000 instead of 8081 for the Django
application. This change affects both the EXPOSE directive and the
Gunicorn binding configuration to standardize on the conventional
default port for web applications.
Update the Dockerfile to use port 8081 instead of 8080 for the application.
This includes:
- Modified EXPOSE directive to port 8081
- Updated Gunicorn bind address to 0.0.0.0:8081
Ensures consistency between the exposed port and the actual port the
application binds to when running inside the container.
Update Dockerfile to expose and bind Gunicorn to port 8080 instead of 8000. This aligns the container port configuration with the expected deployment environment requirements.
Changes:
- Update EXPOSE directive to port 8080
- Update Gunicorn bind address to 0.0.0.0:8080