From e83fd63adf4cecbe92a7552d344f95ce6ee96778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Mon, 21 Oct 2024 17:07:28 +0200 Subject: [PATCH] Update varnish version --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 14 +++----------- config/template.vcl | 2 +- 3 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..322793b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: Build + +on: + push: + branches: + - master + tags: + - '*' + +jobs: + build-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + tags: | + ghcr.io/${{ github.repository }}:latest, + ghcr.io/${{ github.repository }}:${{ github.ref_name }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest + cache-to: type=inline + push: true diff --git a/Dockerfile b/Dockerfile index 27594d8..09184e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,12 @@ -FROM ubuntu:bionic-20181018 +FROM varnish:7.6.0 USER root RUN DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y curl && \ - curl -s https://packagecloud.io/install/repositories/varnishcache/varnish60lts/script.deb.sh | bash &&\ - apt-get install -y varnish varnish-dev && \ apt-get clean -RUN mkdir /tmp/varnish && \ - cd /tmp/varnish && \ - curl https://download.varnish-software.com/varnish-modules/varnish-modules-0.15.0.tar.gz -o modules.tar.gz && \ - tar zxvf modules.tar.gz && \ - cd varnish-modules-0.15.0 && \ - ./configure && make && make install && \ - rm -rf /tmp/varnish - RUN curl -s https://raw.githubusercontent.com/camptocamp/docker-odoo-project/master/install/dockerize.sh | bash COPY config/template.vcl /template.vcl @@ -26,4 +16,6 @@ EXPOSE 80 ENTRYPOINT ["/entrypoint.sh"] +USER varnish + CMD ["/usr/sbin/varnishd","-F", "-f", "/etc/varnish/default.vcl"] diff --git a/config/template.vcl b/config/template.vcl index 08f8f56..8c1ce74 100644 --- a/config/template.vcl +++ b/config/template.vcl @@ -10,7 +10,7 @@ # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. -vcl 4.0; +vcl 4.1; import header; import cookie;