-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (47 loc) · 1.77 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
53
54
55
# <WARNING>
# Everything within sections like <TAG> is generated and can
# be automatically replaced on deployment. You can disable
# this functionality by simply removing the wrapping tags.
# </WARNING>
# <DOCKER_FROM>
FROM divio/base:4.18-py3.6-slim-stretch
# </DOCKER_FROM>
RUN apt update && curl -sL https://deb.nodesource.com/setup_10.x| bash\
&& apt-get install -y nodejs uwsgi-plugin-python\
&& rm -rf /var/lib/apt/lists/*
# <NPM>
# package.json is put into / so that mounting /app for local
# development does not require re-running npm install
ENV PATH=/node_modules/.bin:$PATH
COPY package.json /
RUN (cd / && npm install --production && rm -rf /tmp/*)
# </NPM>
# <BOWER>
# </BOWER>
# we want to keep project-specific sources in the "src" folder
ENV PYTHONPATH=/app/src:$PYTHONPATH
# <PYTHON>
ENV PIP_INDEX_URL=${PIP_INDEX_URL:-https://wheels.aldryn.net/v1/aldryn-extras+pypi/${WHEELS_PLATFORM:-aldryn-baseproject-py3}/+simple/} \
WHEELSPROXY_URL=${WHEELSPROXY_URL:-https://wheels.aldryn.net/v1/aldryn-extras+pypi/${WHEELS_PLATFORM:-aldryn-baseproject-py3}/}
COPY requirements.* /app/
COPY addons-dev /app/addons-dev/
RUN pip-reqs compile && \
pip-reqs resolve && \
pip install \
--no-index --no-deps \
--requirement requirements.urls
# </PYTHON>
# This app is automatically installed by the aldryn-django-cms package.
# There are legacy reasons for this but in this case we cna just remove it.
# Can't leave it in because both this and django-recaptcha have a captcha package :/
RUN pip uninstall --yes django-simple-captcha && pip install django-recaptcha==2.0.6
# <SOURCE>
COPY . /app
# </SOURCE>
# <GULP>
# </GULP>
RUN npm run build
RUN rm -rf /static/*
# <STATIC>
RUN DJANGO_MODE=build python manage.py collectstatic --noinput
# </STATIC>