Skip to content
Open
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
18 changes: 10 additions & 8 deletions connector-definition/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ COPY requirements.txt /functions/

WORKDIR /functions

RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install -r requirements.txt

COPY ./ /functions

# create the group and user
RUN adduser -u 1000 python

RUN chown -R python:python /functions

# stating USER before WORKDIR means the directory is created with the non-root proper ownership
USER python
# Switch to python user before activating venv - the alternative is to run chown on installed
# dependencies afterward, which takes a long time.
USER python

RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip>=25.3 && \
pip install -r requirements.txt

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