Skip to content

Commit

Permalink
fix(review): cleanup Dockerfile, use CADDY_GLOBAL_OPTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweak committed Sep 12, 2023
1 parent 0a86bc8 commit 7ede32f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 1 addition & 3 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ ARG TARGETARCH
WORKDIR /srv/app

# Download Caddy compiled with the Mercure and Vulcain modules
ADD --chmod=500 https://caddyserver.com/api/download?os=linux&arch=$TARGETARCH&p=github.com/dunglas/mercure/caddy&p=github.com/dunglas/vulcain/caddy&p=github.com/caddyserver/cache-handler /usr/bin/caddy
# Uncomment the following for experimental HTTP cache features
# ADD --chmod=500 https://caddyserver.com/api/download?os=linux&arch=$TARGETARCH&p=github.com/dunglas/mercure/caddy&p=github.com/dunglas/vulcain/caddy&p=github.com/darkweak/souin/plugins/caddy /usr/bin/caddy
ADD --chmod=500 https://caddyserver.com/api/download?os=linux&arch=$TARGETARCH&p=github.com/dunglas/mercure/caddy&p=github.com/dunglas/vulcain/caddy&p=github.com/darkweak/souin/plugins/caddy /usr/bin/caddy

COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile

Expand Down
7 changes: 7 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ services:
environment:
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
CADDY_GLOBAL_OPTIONS: |
order cache before rewrite
cache {
api {
souin
}
}

database:
environment:
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ services:
SERVER_NAME: ${SERVER_NAME:-localhost}, caddy:80
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
CADDY_GLOBAL_OPTIONS: |
order cache before rewrite
cache {
api {
souin
}
}
restart: unless-stopped
volumes:
- php_socket:/var/run/php
Expand Down

0 comments on commit 7ede32f

Please sign in to comment.