-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
44 lines (35 loc) · 1.32 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
FROM python:3.7.1-slim-stretch as builder
MAINTAINER Rémy Greinhofer <remy.greinhofer@requestyoracks.org>
# Install packages.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Switch to the directory containing the code.
WORKDIR /usr/src/app
# Copy the code base.
COPY . .
# Build the packages.
RUN rm -fr dist \
&& python setup.py bdist_wheel
###
# Create the release image.
FROM python:3.7.1-slim-stretch
MAINTAINER Rémy Greinhofer <remy.greinhofer@requestyoracks.org>
# Copy the package and install it.
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist /usr/src/app
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& pip install -U git+https://github.com/celery/celery.git@master#egg=celery \
# The commands above are part of a hack to install Celery from the master branch in order to be able run it with
# Python 3.7. Once Celery 4.3 or 5 gets released, they could be safely removed.
&& pip install --no-cache-dir api-*-py3-none-any.whl
# Copy entry point.
COPY docker/docker-entrypoint.sh /
# Set entrypoint.
ENTRYPOINT ["/docker-entrypoint.sh"]