Skip to content

Commit c0735d0

Browse files
committed
Update backend image build process
1 parent 44153bf commit c0735d0

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/run-ci-cd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ jobs:
286286
- name: Build backend image
287287
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
288288
with:
289+
build-args: |
290+
OWASP_GID=1001
291+
OWASP_UID=1001
289292
cache-from: |
290293
type=gha
291294
type=registry,ref=owasp/nest:backend-staging-cache
@@ -515,6 +518,9 @@ jobs:
515518
- name: Build backend image
516519
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
517520
with:
521+
build-args: |
522+
OWASP_GID=1002
523+
OWASP_UID=1002
518524
cache-from: |
519525
type=gha
520526
type=registry,ref=owasp/nest:backend-staging-cache

backend/docker/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
FROM python:3.13.5-alpine AS builder
22

3+
ARG OWASP_GID=1000
4+
ARG OWASP_UID=1000
5+
36
ENV APK_CACHE_DIR="/home/owasp/.cache/apk" \
47
APK_SYMLINK_DIR="/etc/apk/cache" \
5-
OWASP_GID=1000 \
6-
OWASP_UID=1000 \
8+
OWASP_GID=${OWASP_GID} \
9+
OWASP_UID=${OWASP_UID} \
710
PIP_CACHE_DIR="/home/owasp/.cache/pip" \
811
POETRY_CACHE_DIR="/home/owasp/.cache/pypoetry" \
912
POETRY_VIRTUALENVS_IN_PROJECT=true \
@@ -39,8 +42,8 @@ COPY templates templates
3942
FROM python:3.13.5-alpine
4043

4144
RUN apk update && \
42-
addgroup -S owasp && \
43-
adduser -S -h /home/owasp -G owasp owasp
45+
addgroup -S -g ${OWASP_GID} owasp && \
46+
adduser -S -h /home/owasp -u ${OWASP_UID} -G owasp owasp
4447

4548
ENV FORCE_COLOR=1 \
4649
PATH="/home/owasp/.venv/bin:$PATH" \

0 commit comments

Comments
 (0)