Skip to content

Instantly share code, notes, and snippets.

@aoirint
Created September 9, 2022 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aoirint/55d16f25be4145b426df6bab10cc8a59 to your computer and use it in GitHub Desktop.
Save aoirint/55d16f25be4145b426df6bab10cc8a59 to your computer and use it in GitHub Desktop.
Python General User Dockerfile (Debian)
FROM python:3.9
ARG DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PATH=/home/user/.local/bin:${PATH}
RUN apt-get update && \
apt-get install -y \
gosu && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN groupadd --non-unique --gid 1000 user && \
useradd --non-unique --uid 1000 --gid 1000 --create-home user
ADD requirements.txt /
RUN gosu user pip3 install -r /requirements.txt
WORKDIR /code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment