mount caddy data, no cache in dev env

This commit is contained in:
L. Fox 2025-04-06 16:55:23 +02:00
parent b59ee58f6e
commit f61f5ec8d2
3 changed files with 2 additions and 21 deletions

View file

@ -1,6 +1,7 @@
volumes:
postgres_data: {}
opensearch_data: {}
caddy_data: {}
app_cargo_data: {}
app_build_data: {}
app_deps_data: {}
@ -96,6 +97,7 @@ services:
volumes:
- .:/srv/philomena
- ./docker/web/config:/etc/caddy
- caddy_data:/data
environment:
- APP_DIR=/srv/philomena
- S3_ENDPOINT=http://files:80

View file

@ -3,7 +3,6 @@ ARG CADDY_VERSION="2.9.1"
FROM caddy:$CADDY_VERSION-builder-alpine AS builder
RUN xcaddy build \
--with github.com/caddyserver/cache-handler \
--with github.com/sagikazarmark/caddy-fs-s3
FROM caddy:$CADDY_VERSION-alpine
@ -11,4 +10,3 @@ FROM caddy:$CADDY_VERSION-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
EXPOSE 80
EXPOSE 443

View file

@ -1,22 +1,4 @@
{
# Caching should be based on URL, not rewritten URL.
order cache before rewrite
cache {
ttl 10h
default_cache_control public
cache_name Philomena
# Simplify cache keys to maximize hit rate.
key {
disable_body
disable_host
disable_method
disable_query
disable_scheme
}
}
filesystem philomena s3 {
bucket {$S3_BUCKET}
endpoint {$S3_ENDPOINT}
@ -27,7 +9,6 @@
(s3path) {
handle {args[0]} {
cache
rewrite {args[0]} {args[1]}
file_server {
fs philomena