Last active
March 31, 2022 10:56
-
-
Save DahlitzFlorian/3c0198a851be9208ac30ba12af241a33 to your computer and use it in GitHub Desktop.
Run Python application as non-root in Docker - requirements.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7.2-alpine | |
RUN pip install --upgrade pip | |
RUN adduser -D worker | |
USER worker | |
WORKDIR /home/worker | |
COPY --chown=worker:worker requirements.txt requirements.txt | |
RUN pip install --user -r requirements.txt | |
ENV PATH="/home/worker/.local/bin:${PATH}" | |
COPY --chown=worker:worker . . | |
LABEL maintainer="Your Name <[email protected]>" \ | |
version="1.0.0" | |
CMD ["python"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment