Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event.inputs.tag != '' }}

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
Expand All @@ -73,3 +74,32 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=kz-scoring-api
cache-to: type=gha,scope=kz-scoring-api,mode=max

# Mirror the freshly-pushed ghcr image to Selectel Cloud registry so PKB
# (which pulls through their reg.1cb.kz alias -> cr.selcloud.ru/aggregion/main)
# gets the same digest. Only runs on non-PR builds (nothing to mirror otherwise).
- name: Log in to Selectel Cloud registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: cr.selcloud.ru
username: ${{ secrets.SELCLOUD_USERNAME }}
password: ${{ secrets.SELCLOUD_PASSWORD }}

- name: Mirror image to Selectel Cloud
if: github.event_name != 'pull_request'
env:
SRC_TAGS: ${{ steps.meta.outputs.tags }}
DST_PREFIX: cr.selcloud.ru/aggregion/main/kz-scoring-api
run: |
set -eu
# Map each ghcr tag `ghcr.io/aggregion/kz-scoring-api:X` -> `<DST_PREFIX>:X`
# and copy via `docker buildx imagetools create` (multi-arch/attestation-safe,
# no local pull needed).
echo "$SRC_TAGS" | while IFS= read -r src; do
[ -z "$src" ] && continue
tag="${src##*:}"
dst="${DST_PREFIX}:${tag}"
echo ">> mirroring $src -> $dst"
docker buildx imagetools create --tag "$dst" "$src"
done
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ RUN useradd --create-home --uid 10001 app

COPY --from=builder /install /usr/local

# LightGBM boosters baked in — read from these paths by default. Overridable
# via KZ_SCORING_{HH,CG}_MODEL_PATH env or by mounting a different volume at
# /models. Rotation = PR replacing models/*.txt + new release tag.
COPY --chown=10001:10001 models/ /models/
ENV KZ_SCORING_HH_MODEL_PATH=/models/hh_beeline_bezzalog_2026_05_04_model.txt \
KZ_SCORING_CG_MODEL_PATH=/models/cg_beeline_bezzalog_2026_05_04_model.txt

WORKDIR /home/app
USER app

Expand Down
Loading
Loading