Summary
Provide optional example configuration and documentation for integrating a dedicated web server (such as Nginx or Caddy) into the Docker Compose setup to serve static files and proxy application requests.
Additionally, provide a reverse proxy configuration (with HTTPS termination) as an example for production deployments.
Motivation
While WhiteNoise is suitable for many deployments, using a dedicated web server is a best practice for larger-scale or production environments. Including example configurations for popular web servers and reverse proxy setups will make it easier for users to adopt these best practices when needed, while still allowing flexibility in the choice of web server.
Detailed Description
- Add example service definitions for a dedicated web server (e.g., Nginx or Caddy) to the Docker Compose setup.
- Provide example configuration files (such as
nginx.conf or Caddyfile) for serving static files from the STATIC_ROOT directory and proxying dynamic requests to the Django application.
- Provide example reverse proxy configuration (including HTTPS termination) for production deployments.
- Update documentation to explain when and how to use these configurations as an alternative to WhiteNoise, and clarify that users may choose any web server that fits their needs.
- Document the recommended production setup: Django app behind a reverse proxy with HTTPS, static files served by the webserver.
Possible Implementation
- Add optional example web server services (such as Nginx or Caddy) to
docker-compose.yml.
- Include example configuration files in the repository.
- Add example reverse proxy configuration for HTTPS termination.
- Update deployment documentation with instructions for enabling and customizing these services, and mention that other web servers can be used as well.
- Clearly document the difference between development (WhiteNoise, HTTP) and production (reverse proxy, HTTPS) setups.
Tasks
Acceptance Criteria
- Example web server configurations (such as Nginx or Caddy) are present in the repository.
- Example reverse proxy configuration for HTTPS is available.
- Docker Compose can be easily extended to use a dedicated web server and reverse proxy if desired.
- Documentation clearly explains usage, trade-offs, and keeps the choice of web server open.
- Production deployment best practices are documented.
Additional Context
Summary
Provide optional example configuration and documentation for integrating a dedicated web server (such as Nginx or Caddy) into the Docker Compose setup to serve static files and proxy application requests.
Additionally, provide a reverse proxy configuration (with HTTPS termination) as an example for production deployments.
Motivation
While WhiteNoise is suitable for many deployments, using a dedicated web server is a best practice for larger-scale or production environments. Including example configurations for popular web servers and reverse proxy setups will make it easier for users to adopt these best practices when needed, while still allowing flexibility in the choice of web server.
Detailed Description
nginx.conforCaddyfile) for serving static files from theSTATIC_ROOTdirectory and proxying dynamic requests to the Django application.Possible Implementation
docker-compose.yml.Tasks
Acceptance Criteria
Additional Context