ARG APP_USER_UID=1000
ARG APP_USER_GID=1000
ARG IMAGE_ID=development.00000000

FROM docker-hosted.nexus.bthlabs.pl/hotpocket/base:build-node-20250819-01 AS development

ARG APP_USER_UID
ARG APP_USER_GID
ARG IMAGE_ID

USER root

# COPY --chown=$APP_USER_UID:$APP_USER_GID extension/ops/bin/*.sh /srv/bin/
RUN chown -R ${APP_USER_UID}:${APP_USER_GID} /srv

USER app

VOLUME ["/srv/node_modules", "/srv/venv"]

FROM development AS ci

COPY --chown=$APP_USER_UID:$APP_USER_GID extension/ /srv/app/
COPY --chown=$APP_USER_UID:$APP_USER_GID packages/ /srv/packages/
COPY --chown=$APP_USER_UID:$APP_USER_GID tls/ /srv/tls/

RUN chown -R $APP_USER_UID:$APP_USER_GID /srv
