forked from apache/airavata-django-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
92 lines (72 loc) · 3.24 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
FROM node:lts-alpine as build-stage
RUN apk add yarn
# build api javascript
WORKDIR /code/django_airavata/apps/api
COPY ./django_airavata/apps/api/package.json ./django_airavata/apps/api/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/api/ .
RUN yarn run build
# build common javascript
WORKDIR /code/django_airavata/static/common
COPY ./django_airavata/static/common/package.json ./django_airavata/static/common/yarn.lock ./
RUN yarn
COPY ./django_airavata/static/common/ .
RUN yarn run build
# build admin javascript
WORKDIR /code/django_airavata/apps/admin
COPY ./django_airavata/apps/admin/package.json ./django_airavata/apps/admin/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/admin/ .
RUN yarn run build
# build groups javascript
WORKDIR /code/django_airavata/apps/groups
COPY ./django_airavata/apps/groups/package.json ./django_airavata/apps/groups/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/groups/ .
RUN yarn run build
# build workspace/django-airavata-workspace-plugin-api javascript
WORKDIR /code/django_airavata/apps/workspace/django-airavata-workspace-plugin-api
COPY ./django_airavata/apps/workspace/django-airavata-workspace-plugin-api/package.json ./django_airavata/apps/workspace/django-airavata-workspace-plugin-api/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/workspace/django-airavata-workspace-plugin-api/ .
RUN yarn run build
# build workspace javascript
WORKDIR /code/django_airavata/apps/workspace
COPY ./django_airavata/apps/workspace/package.json ./django_airavata/apps/workspace/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/workspace/ .
RUN yarn run build
# build dataparsers javascript
WORKDIR /code/django_airavata/apps/dataparsers
COPY ./django_airavata/apps/dataparsers/package.json ./django_airavata/apps/dataparsers/yarn.lock ./
RUN yarn
COPY ./django_airavata/apps/dataparsers/ .
RUN yarn run build
FROM python:3.6.5 as server-stage
ENV PYTHONUNBUFFERED 1
ENV OAUTHLIB_INSECURE_TRANSPORT 1
EXPOSE 8000
WORKDIR /code
COPY requirements.txt requirements-mysql.txt ./
COPY setup.* ./
COPY README.md .
RUN pip install -r requirements.txt
RUN pip install -r requirements-mysql.txt
# Copy in a default settings_local.py file
COPY ./django_airavata/settings_local.py.sample ./django_airavata/settings_local.py
COPY ./ .
# Copy javascript builds from build-stage
WORKDIR /code/django_airavata/apps/api/static/django_airavata_api
COPY --from=build-stage /code/django_airavata/apps/api/static/django_airavata_api .
WORKDIR /code/django_airavata/static/common
COPY --from=build-stage /code/django_airavata/static/common .
WORKDIR /code/django_airavata/apps/admin/static/django_airavata_admin
COPY --from=build-stage /code/django_airavata/apps/admin/static/django_airavata_admin .
WORKDIR /code/django_airavata/apps/groups/static/django_airavata_groups
COPY --from=build-stage /code/django_airavata/apps/groups/static/django_airavata_groups .
WORKDIR /code/django_airavata/apps/workspace/static/django_airavata_workspace
COPY --from=build-stage /code/django_airavata/apps/workspace/static/django_airavata_workspace .
WORKDIR /code/django_airavata/apps/dataparsers/static/django_airavata_dataparsers
COPY --from=build-stage /code/django_airavata/apps/dataparsers/static/django_airavata_dataparsers .
WORKDIR /code
ENTRYPOINT ["/code/scripts/start-server.sh"]