From f820f5ab7573c3990fb2ed4e8e902ab53cd1f462 Mon Sep 17 00:00:00 2001 From: Dustin Kroeger Date: Mon, 25 Mar 2024 14:04:56 +0100 Subject: [PATCH] add Caddyfile --- docs/docker_compose_deployment.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/docker_compose_deployment.md b/docs/docker_compose_deployment.md index 6d5a411..10a7fbb 100644 --- a/docs/docker_compose_deployment.md +++ b/docs/docker_compose_deployment.md @@ -37,7 +37,6 @@ If, for whatever reason, a production deployment should be used with **sqlite3** For this we slightly modify the deployment volumes: ```yaml ---- volumes: - db:/usr/src/app/db.sqlite3 - /opt/paw/media:/usr/src/app/media @@ -46,6 +45,8 @@ volumes: Now you write directives in your config to host these files, the following snipped shows an example nginx config: +#### Example nginx config + ```nginx upstream paw { server localhost:8000; @@ -76,4 +77,23 @@ server { } ``` +#### Example Caddyfile + +``` +example.com { + + handle /static/* { + file_server /opt/paw/static/* + } + + handle /media/* { + file_server /opt/paw/media/* + } + + handle { + reverse_proxy 127.0.0.1:8000 + } +} +``` + That's it! You have successfully deployed your project using Docker Compose. -- 2.51.2