forked from girder/girder_worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (30 loc) · 1.06 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
FROM ubuntu:xenial as base
RUN apt-get update && \
apt-get install -qy software-properties-common python-software-properties && \
apt-get update && apt-get install -qy \
build-essential \
wget \
python \
r-base \
libffi-dev \
libssl-dev \
libjpeg-dev \
zlib1g-dev \
libpython-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
FROM base as build
RUN apt-get update && apt-get install -qy git
COPY ./ /girder_worker/
WORKDIR /girder_worker
RUN rm -rf ./dist && python setup.py sdist
FROM base
COPY --from=build /girder_worker/dist/*.tar.gz /
COPY --from=build /girder_worker/docker-entrypoint.sh /docker-entrypoint.sh
RUN pip install /*.tar.gz
RUN useradd -D --shell=/bin/bash && useradd -m worker
RUN chown -R worker:worker /usr/local/lib/python2.7/dist-packages/girder_worker/
USER worker
RUN girder-worker-config set celery broker "amqp://%(RABBITMQ_USER)s:%(RABBITMQ_PASS)s@%(RABBITMQ_HOST)s/"
VOLUME /girder_worker
ENTRYPOINT ["/docker-entrypoint.sh"]