# Base Image FROM python:3.10.0-buster RUN apt-get update && apt-get install -y tini ENV APP_HOME=/opt/app # Create directory for the app RUN mkdir $APP_HOME WORKDIR $APP_HOME # Create the app user RUN groupadd app && useradd -g app app # Install Requirements COPY requirements.txt . RUN pip install --no-cache -r requirements.txt # Install app COPY . . # Chown all the files to the app user RUN chown -R app:app $APP_HOME # Change to the app user USER app ENTRYPOINT ["./entrypoint.sh"] CMD ["gunicorn", "--worker-tmp-dir", "/dev/shm", "--workers=2", "--log-level=-", "--threads=4", \ "--worker-class", "gthread", "--bind", "0.0.0.0:5000", "wsgi:app"]