From c745e9acc66dcf7039d76413e951457cfc1489d5 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Tue, 14 Jul 2026 20:42:49 +0200 Subject: [PATCH] Build docker image with pthon sidecar as well. --- .gitlab-ci.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7334c25..7cea02a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,14 @@ stages: - build -# Builds the production image (see Dockerfile: bun build → dist/, served by -# `bun src/index.ts`) and pushes it to this project's GitLab Container Registry. +# Builds BOTH production image flavors (see Dockerfile) and pushes them to this +# project's GitLab Container Registry: +# - default target `runtime` → : / :latest (Bun-only) +# - target `with-server-engine` → :-server-engine / +# :latest-server-engine (+ python3 / faster-whisper) # # docker run -p 3000:3000 -v whisper-data:/app/data $CI_REGISTRY_IMAGE:latest +# docker run -p 3000:3000 -v whisper-data:/app/data $CI_REGISTRY_IMAGE:latest-server-engine build-image: stage: build image: docker:27 @@ -14,16 +18,24 @@ build-image: DOCKER_TLS_CERTDIR: "/certs" IMAGE_SHA: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest + IMAGE_SHA_FW: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-server-engine + IMAGE_LATEST_FW: $CI_REGISTRY_IMAGE:latest-server-engine before_script: - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY" script: - docker build --pull -t "$IMAGE_SHA" . + # with-server-engine extends the runtime stage, so this build reuses every + # layer from the one above and only adds the python/faster-whisper layer. + - docker build --target with-server-engine -t "$IMAGE_SHA_FW" . - docker push "$IMAGE_SHA" - # Only the default branch moves the :latest tag. + - docker push "$IMAGE_SHA_FW" + # Only the default branch moves the :latest tags. - | if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then docker tag "$IMAGE_SHA" "$IMAGE_LATEST" docker push "$IMAGE_LATEST" + docker tag "$IMAGE_SHA_FW" "$IMAGE_LATEST_FW" + docker push "$IMAGE_LATEST_FW" fi rules: - if: $CI_COMMIT_BRANCH