FROM python:3.9 RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" ENV PYTHONUNBUFFERED=1 WORKDIR /code COPY --chown=user ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY --chown=user . /code/ USER root RUN chmod +x /code/start.sh USER user CMD ["/bin/bash", "/code/start.sh"]