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
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ RUN echo ${CONNECTOR_VERSION} > /scripts/CONNECTOR_VERSION
COPY /functions /functions
RUN /scripts/package-restore.sh

# Create non-root user, let useradd pick a unique UID
RUN useradd -m -s /bin/bash hasura \
# Explicitly set UID/GID to match the cache mount used in ./connector-definition/Dockerfile
RUN groupadd -g 1001 hasura \
&& useradd -m -s /bin/bash -u 1001 -g hasura hasura \
&& chown -R hasura:hasura /scripts /functions

USER hasura
Expand Down
2 changes: 1 addition & 1 deletion connector-definition/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ghcr.io/hasura/ndc-nodejs-lambda:v{{VERSION}}
COPY --chown=hasura:hasura package-lock.json package.json /functions/

WORKDIR /functions
RUN --mount=type=cache,target=/home/hasura/.npm,uid=1000,gid=1000 \
RUN --mount=type=cache,target=/home/hasura/.npm,uid=1001,gid=1001 \
npm ci

COPY --chown=hasura:hasura ./ /functions