infra_snippets/kubernetes/autoscale/service/Dockerfile

18 lines
446 B
Docker
Raw Permalink Normal View History

2021-07-25 01:23:40 +00:00
FROM python:3.9
RUN useradd -m -g nogroup server
USER server
WORKDIR /home/server
ENV FLASK_APP=main.py
# Perform the install of requirements first to avoid re-installing on every code change
COPY requirements.txt /home/server/
RUN pip install -r /home/server/requirements.txt
COPY *.py /home/server/
# CMD ["python", "/home/server/main.py"]
CMD ["/home/server/.local/bin/gunicorn", "--config", "/home/server/gunicorn.conf.py", "main:app"]