From 82d3ba034627374371f76038100d254fc0b9ce1d Mon Sep 17 00:00:00 2001 From: "hidde.wieringa" Date: Sat, 30 Mar 2024 15:59:03 +0100 Subject: [PATCH] improve docker compose caching --- .github/workflows/deploy.yml | 7 ++++++- docker-compose.yml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2986a114..cf985200 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -66,6 +66,10 @@ jobs: # run: | # curl --progress-bar http://ftp.snt.utwente.nl/pub/misc/openstreetmap/europe-latest.osm.pbf --output data/europe.osm.pbf + # The disk and memory in the Github runners is too small to do large imports. + # A Docker image with a pre-imported database state is used. + # During the deployment run, the docker image is updated through the replication updated, + # comitted to a new image and pushed for future used. - name: Pull import database run: | docker compose pull db @@ -98,7 +102,8 @@ jobs: - name: Generate tiles run: | docker compose up --no-build --pull never --detach db - docker compose up --build martin-cp + docker compose build martin-cp + docker compose run --no-build martin-cp - name: Deploy run: | diff --git a/docker-compose.yml b/docker-compose.yml index 1648aba8..26d92ae4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,8 @@ services: build: context: . dockerfile: import.Dockerfile + cache_from: + - ghcr.io/hiddewie/openrailwaymap-import:latest depends_on: - db volumes: