add dockerfile and prep for prod

This commit is contained in:
Tobias Brunner 2025-01-30 15:12:50 +01:00
parent 8c9671602b
commit 9aeab6ee3b
No known key found for this signature in database
5 changed files with 94 additions and 1 deletions

40
docker/Caddyfile Normal file
View file

@ -0,0 +1,40 @@
{
auto_https off
log {
output stderr
format console
level ERROR
}
}
:8080 {
# Health check endpoint
handle /healthz {
respond "OK" 200
}
# Handle static files
handle /static/* {
uri strip_prefix /static
root * /app/staticfiles
file_server
}
# Handle media files
handle /media/* {
uri strip_prefix /media
root * /app/mediafiles
file_server
}
# Proxy all other requests to Gunicorn
handle {
reverse_proxy unix//run/gunicorn.sock
}
respond /healthz "OK" 200
header Cache-Control no-cache
# Basic compression for better performance
encode gzip
}