-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-dev
57 lines (45 loc) · 1.91 KB
/
Dockerfile-dev
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
53
54
55
56
57
#
FROM muccg/turtle-builder
MAINTAINER https://github.com/muccg/
# At build time changing these args allow us to use a local devpi mirror
# Unchanged, these defaults allow pip to behave as normal
ARG ARG_PIP_INDEX_URL="https://pypi.python.org/simple"
ARG ARG_PIP_TRUSTED_HOST="127.0.0.1"
# Runtime args
ENV DEPLOYMENT dev
ENV PRODUCTION 0
ENV DEBUG 1
ENV PIP_INDEX_URL $ARG_PIP_INDEX_URL
ENV PIP_TRUSTED_HOST $ARG_PIP_TRUSTED_HOST
# Strictly speaking not needed as we mount over the top
# However let's make it explicit that we don't want /app from the build image
RUN rm -rf /app && mkdir -p /app
# # For dev we use root so we can shell in and do evil things
USER root
WORKDIR /app
RUN env | sort
# Add our python deps in multiple docker layers
COPY requirements/dev-requirements.txt /app/requirements/
RUN NO_PROXY=${PIP_TRUSTED_HOST} pip3 install --upgrade -r requirements/dev-requirements.txt
COPY requirements/test-requirements.txt /app/requirements/
RUN NO_PROXY=${PIP_TRUSTED_HOST} pip3 install --upgrade -r requirements/test-requirements.txt
COPY requirements/migration.txt /app/requirements/
RUN NO_PROXY=${PIP_TRUSTED_HOST} pip3 install --upgrade -r requirements/migration.txt
COPY requirements/runtime-requirements.txt /app/requirements/
RUN NO_PROXY=${PIP_TRUSTED_HOST} pip3 install --upgrade -r requirements/runtime-requirements.txt
# Cache npm deps into /npm
COPY package.json /npm/package.json
RUN cd /npm && npm install --ignore-scripts
# Cache bower deps into /bower
COPY bower.json /bower/bower.json
RUN cd /bower && /npm/node_modules/.bin/bower install --allow-root --config.interactive=false
# Copy code and install the app
COPY . /app
RUN NO_PROXY=${PIP_TRUSTED_HOST} pip3 ${PIP_OPTS} install --upgrade -e .
EXPOSE 3000 3001 9000 9001 9100 9101
VOLUME ["/app", "/data"]
ENV HOME /data
WORKDIR /data
# entrypoint shell script that by default starts runserver
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["runserver"]