-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (29 loc) · 837 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.8 as builder
# metadata
MAINTAINER steder@gmail.com
LABEL version="1.0"
ENV ENV=development
# actual container setup:
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y build-essential \
&& apt-get install -y imagemagick \
git \
python \
python-dev \
python-pip \
&& pip install poetry \
&& rm -rf /var/lib/apt/lists/*
FROM builder as giraffe
# Giraffe listens on 9876 by default
EXPOSE 9876
# let's get the code!
WORKDIR /opt/app
COPY pyproject.toml poetry.lock /opt/app/
RUN poetry install --no-root --no-dev
COPY . /opt/app
RUN poetry install --no-dev
CMD ["poetry", "gunicorn", "-k", "gevent", "-c", "etc/gunicorn.conf.py", "giraffe:app", "--log-level=DEBUG"]
from giraffe as dev
RUN poetry install
CMD ["poetry", "run", "python", "/opt/app/giraffe.py"]