mirror of
https://github.com/KevinMidboe/infra-map.git
synced 2025-12-07 19:59:07 +00:00
template varnish config using gomplate
This commit is contained in:
@@ -21,7 +21,19 @@ RUN git clone https://github.com/varnish/libvmod-digest.git /opt/libvmod-digest
|
||||
./configure VARNISHSRC=/usr/include/varnish && \
|
||||
make && make install
|
||||
|
||||
COPY . /etc/varnish/
|
||||
COPY --from=hairyhenderson/gomplate:stable /gomplate /bin/gomplate
|
||||
|
||||
ARG HASS_HOST
|
||||
ARG FRONTEND_HOST
|
||||
ENV HASS_HOST=$HASS_HOST
|
||||
ENV FRONTEND_HOST=$FRONTEND_HOST
|
||||
|
||||
COPY default.vcl.tmpl /etc/varnish/
|
||||
COPY *.vcl /etc/varnish/
|
||||
COPY includes /etc/varnish/includes
|
||||
|
||||
RUN gomplate -f /etc/varnish/default.vcl.tmpl -o /etc/varnish/default.vcl
|
||||
RUN rm /etc/varnish/default.vcl.tmpl
|
||||
|
||||
EXPOSE 6081
|
||||
|
||||
|
||||
@@ -3,20 +3,18 @@ vcl 4.0;
|
||||
import std;
|
||||
import digest;
|
||||
|
||||
# include "handlers/ttl-override-handler.vcl";
|
||||
include "includes/x-cache-header.vcl";
|
||||
|
||||
include "vcl_deliver.vcl";
|
||||
|
||||
# Define backend pointing to Home Assistant IP
|
||||
backend hass_backend {
|
||||
.host = "10.0.0.82";
|
||||
.host = "{{ getenv `HASS_HOST` `homeassistant.local` }}";
|
||||
.port = "8123";
|
||||
}
|
||||
|
||||
backend app_frontend {
|
||||
.host = "host.docker.internal";
|
||||
.port = "5173";
|
||||
.host = "{{ getenv `FRONTEND_HOST` `localhost` }}";
|
||||
.port = "3000";
|
||||
}
|
||||
|
||||
sub vcl_recv {
|
||||
Reference in New Issue
Block a user