-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (32 loc) · 1.24 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
FROM python:3.7-slim AS builder
WORKDIR /app
COPY requirements-*.txt ./
RUN \
sed -i -e 's/^-e .$//' requirements-dev.txt && \
pip wheel --no-cache-dir -w /wheels -r requirements-dev.txt && \
pip wheel --no-cache-dir -w /wheels -r requirements-style.txt && \
pip wheel --no-cache-dir -w /wheels -r requirements-test.txt && \
pip wheel --no-cache-dir -w /wheels -r requirements-typing.txt && \
echo Wheels rolled.
COPY . .
RUN pip wheel --no-cache-dir -w /wheels .
##############################################################################
FROM python:3.7-slim AS dev
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY --from=builder /wheels /wheels
COPY . .
RUN pip install --no-cache-dir -f /wheels -e .
ENTRYPOINT ["pepubot"]
##############################################################################
FROM python:3.7-slim AS prod-installer
WORKDIR /app
COPY --from=builder /wheels /wheels
COPY . .
RUN pip install --no-cache-dir -f /wheels .
##############################################################################
FROM python:3.7-slim AS prod
WORKDIR /app
COPY --from=prod-installer /usr/local/bin /usr/local/bin
COPY --from=prod-installer /usr/local/lib/python3.7 /usr/local/lib/python3.7
ENTRYPOINT ["pepubot"]