forked from cuspaceflight/tawhiri
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
52 lines (40 loc) · 1.15 KB
/
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
43
44
45
46
47
48
49
50
51
52
# -------------------
# The build container
# -------------------
FROM debian:buster-slim AS build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-cffi \
libffi-dev \
python3-wheel \
unzip && \
rm -rf /var/lib/apt/lists/*
COPY . /root/tawhiri
RUN cd /root/tawhiri && \
pip3 install --user --no-warn-script-location --ignore-installed -r requirements.txt && \
python3 setup.py build_ext --inplace
# -------------------------
# The application container
# -------------------------
FROM debian:buster-slim
EXPOSE 8000/tcp
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
imagemagick \
python3 \
tini && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /root/.local /root/.local
COPY --from=build /root/tawhiri /root/tawhiri
RUN rm /etc/ImageMagick-6/policy.xml && \
mkdir -p /run/tawhiri
WORKDIR /root
ENV PATH=/root/.local/bin:$PATH
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD /root/.local/bin/gunicorn -b 0.0.0.0:8000 --worker-class gevent -w 12 tawhiri.api:app