diff --git a/.github/workflows/publish-pmtiles.yml b/.github/workflows/publish-pmtiles.yml index 2d37c4e..a736127 100644 --- a/.github/workflows/publish-pmtiles.yml +++ b/.github/workflows/publish-pmtiles.yml @@ -149,6 +149,38 @@ jobs: pmtiles/parcels.pmtiles data-source-checksums.txt + publish-boundaries-vector-docker-image: + name: Vector docker image build and push + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: + - generate-geopackage + - generate-pmtiles + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: pmtiles + path: vector/docker/static/tiles + merge-multiple: true + + - name: Build & tag docker image + uses: AplinkosMinisterija/reusable-workflows/.github/actions/docker-build-tag-push@main + with: + docker-image: ghcr.io/govlt/national-boundaries-vector + docker-context: vector/docker/static + file: vector/docker/static/Dockerfile + environment: ${{ (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'pre')) && 'stable' || 'preview' }} + no-cache: true + push: true + cache-from: '' + cache-to: '' + publish-page: name: Publish page runs-on: ubuntu-latest diff --git a/vector/docker/static/Dockerfile b/vector/docker/static/Dockerfile new file mode 100644 index 0000000..bf1b769 --- /dev/null +++ b/vector/docker/static/Dockerfile @@ -0,0 +1,11 @@ +FROM caddy:2.8 + +EXPOSE 80 + +HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD wget -qO- http://127.0.0.1:80/health || exit 1 + +# Copy Caddyfile +COPY ./caddy/Caddyfile /etc/caddy/Caddyfile + +# Copy built files from the build stage +COPY ./tiles /srv/ \ No newline at end of file diff --git a/vector/docker/static/caddy/Caddyfile b/vector/docker/static/caddy/Caddyfile new file mode 100644 index 0000000..f0a50c4 --- /dev/null +++ b/vector/docker/static/caddy/Caddyfile @@ -0,0 +1,27 @@ +{ + auto_https off + + servers { + trusted_proxies static private_ranges + } +} + +:80 + +root * /srv + +handle /health { + log_skip + @goingDown vars {http.shutting_down} true + respond @goingDown "Bye-bye in {http.time_until_shutdown}" 503 + respond "OK" +} + +try_files {path} {file} +file_server + +header -Server + +handle_errors { + header -Server +}