capsul-flask/Dockerfile

32 lines
935 B
Docker
Raw Normal View History

2022-04-20 12:51:31 +00:00
FROM python:3.8-slim as build
RUN apt-get update && apt-get install --no-install-recommends -y \
2022-04-20 09:06:38 +00:00
gcc \
gettext \
git \
libffi-dev \
2022-04-20 12:51:31 +00:00
# postgresql \
2022-04-20 09:06:38 +00:00
python3-dev \
2022-04-20 12:51:31 +00:00
libpq-dev
2022-04-20 09:06:38 +00:00
RUN mkdir -p /app/{code,venv}
WORKDIR /app/code
COPY Pipfile Pipfile.lock /app/code/
RUN python3 -m venv /app/venv
RUN pip install pipenv setuptools
ENV PATH="/app/venv/bin:$PATH" VIRTUAL_ENV="/app/venv"
RUN pip install wheel cppy
# Install dependencies into the virtual environment with Pipenv
RUN pipenv install --deploy --verbose
2022-04-20 12:51:31 +00:00
FROM python:3.8-slim
2022-04-20 12:57:28 +00:00
RUN apt-get install --no-install-recommends -y \
2022-04-20 09:06:38 +00:00
cloud-utils \
2022-04-20 12:57:28 +00:00
libvirt-clients \
2022-04-20 09:06:38 +00:00
openssh-client \
2022-04-20 12:57:28 +00:00
virtinst
2022-04-20 09:06:38 +00:00
COPY . /app/code/
WORKDIR /app/code
COPY --from=build /app/venv /app/venv
ENV PATH="/app/venv/bin:$PATH" VIRTUAL_ENV="/app/venv"
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "-k", "gevent", "--worker-connections", "1000", "app:app"]
VOLUME /app/code
EXPOSE 5000