Dockerfile 501 B

1234567891011
  1. FROM python:3.8.2-slim-buster
  2. WORKDIR /app
  3. COPY ./requirements.txt requirements.txt
  4. ARG APP_USER=appuser
  5. RUN groupadd -r ${APP_USER} && useradd --no-log-init -r -g ${APP_USER} ${APP_USER}
  6. RUN apt-get update && apt-get install -y --no-install-recommends uwsgi uwsgi-plugin-python3 python3-distutils && rm -rf /var/lib/apt/lists/* && pip install -r requirements.txt
  7. COPY ./src /app
  8. USER ${APP_USER}:${APP_USER}
  9. CMD [ "uwsgi", "--http-socket", ":5000", "--plugin","python3", "--ini", "/app/uwsgi.ini" ]