-
Notifications
You must be signed in to change notification settings - Fork 136
/
Dockerfile
58 lines (39 loc) · 1.46 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
56
57
58
FROM node:8 as node
WORKDIR /srv
COPY nextcloudappstore/core/static nextcloudappstore/core/static
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY webpack.config.js webpack.config.js
COPY tsconfig.json tsconfig.json
RUN yarn install
RUN yarn run build
FROM python:3.6 as translations
WORKDIR /srv
RUN apt-get update && apt-get install -y gettext libgettextpo-dev
COPY requirements requirements
RUN pip install -r requirements/base.txt
RUN pip install -r requirements/development.txt
COPY nextcloudappstore nextcloudappstore
COPY manage.py manage.py
COPY locale locale
# provide a temporary secret key in order to be able to run the compile messages command
RUN echo "SECRET_KEY = 'secret'" >> nextcloudappstore/settings/base.py
RUN python manage.py compilemessages --settings=nextcloudappstore.settings.base
FROM python:3.6 as main
ARG platform
ENV PYTHONUNBUFFERED=1
EXPOSE 8000
WORKDIR /srv
COPY requirements requirements
COPY nextcloudappstore nextcloudappstore
COPY manage.py manage.py
COPY scripts/build/start.sh start.sh
RUN rm -r nextcloudappstore/core/static
COPY --from=node /srv/nextcloudappstore/core/static nextcloudappstore/core/static
COPY --from=translations /srv/locale locale
RUN pip install -r requirements/base.txt
RUN pip install -r requirements/${platform}.txt
RUN groupadd nextcloudappstore
RUN useradd -g nextcloudappstore -s /bin/false nextcloudappstore
RUN chown -R nextcloudappstore:nextcloudappstore /srv
ENTRYPOINT ["/srv/start.sh"]