add dockerfile and prep for prod
This commit is contained in:
parent
8c9671602b
commit
9aeab6ee3b
5 changed files with 94 additions and 1 deletions
40
docker/Caddyfile
Normal file
40
docker/Caddyfile
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue