Skip to content

Commit

Permalink
Merge pull request #140 from zazuko/custom-args
Browse files Browse the repository at this point in the history
Add `CUSTOM_ARGS` support
  • Loading branch information
ludovicm67 authored Dec 23, 2024
2 parents 210a445 + 1d2a1f5 commit aecfde9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-gifts-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"varnish-post": minor
---

Add support for `CUSTOM_ARGS`
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ENV CONFIG_FILE="default.vcl"
ENV ENABLE_LOGS="true"
ENV ENABLE_PROMETHEUS_EXPORTER="false"
ENV PURGE_ACL="localhost"
ENV CUSTOM_ARGS=""

# Install some dependencies
RUN apt-get update \
Expand All @@ -48,4 +49,4 @@ COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh

EXPOSE 80 8443 9131
ENTRYPOINT [ "tini", "--", "/entrypoint.sh" ]
CMD [ "tini", "--", "/entrypoint.sh" ]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ You can use following environment variables for configuration:
- `ENABLE_PROMETHEUS_EXPORTER`: enable the Prometheus exporter if set to `true` (default: `false`).
If enabled, the exporter will be available on the 9131 port.
- `PURGE_ACL`: custom ACL for the PURGE method (default: `localhost`) ; you can use `0.0.0.0/0` to allow all.
- `CUSTOM_ARGS`: custom arguments to pass to varnishd (default: `''`)

## Cache invalidation

Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

ENABLE_LOGS="${ENABLE_LOGS}"
ENABLE_PROMETHEUS_EXPORTER="${ENABLE_PROMETHEUS_EXPORTER}"
CUSTOM_ARGS="${CUSTOM_ARGS}"

set -eu

Expand Down Expand Up @@ -55,4 +56,5 @@ varnishd \
-a proxy=:8443,PROXY \
-p feature=+http2 \
-s "malloc,${VARNISH_SIZE}" \
${CUSTOM_ARGS} \
"$@"

0 comments on commit aecfde9

Please sign in to comment.