Build docker image with pthon sidecar as well.
This commit is contained in:
+15
-3
@@ -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` → :<sha> / :latest (Bun-only)
|
||||
# - target `with-server-engine` → :<sha>-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
|
||||
|
||||
Reference in New Issue
Block a user