forked from ITISFoundation/osparc-simcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
100 lines (78 loc) · 2.52 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
92
93
94
95
96
97
98
99
100
FROM node:8.15.0-alpine as base
LABEL maintainer=odeimaiz
# non-root user 'scu'
RUN adduser -D -u 8004 scu
RUN apk add --no-cache \
su-exec
ENV HOME /home/scu
EXPOSE 4000
WORKDIR $HOME
RUN apk update && \
apk add python3 && \
apk add bash && \
apk add git && \
apk add postgresql-dev && \
apk add py-pip
# TODO: Move the devel specific packages to develoment stage
RUN apk add --no-cache \
gcc \
subversion \
g++ \
libc-dev \
libffi-dev \
python3-dev
RUN pip3 install --upgrade pip wheel setuptools
RUN npm install express
# ----------------------------------------------------------------
# set up oSparc env variables
ENV SIMCORE_NODE_UUID="-1" \
SIMCORE_USER_ID="-1" \
SIMCORE_NODE_BASEPATH="/raw" \
STORAGE_ENDPOINT="=1" \
RAWGRAPHS_INPUT_PATH="../inputs" \
RAWGRAPHS_OUTPUT_PATH="../outputs" \
S3_ENDPOINT="=1" \
S3_ACCESS_KEY="-1" \
S3_SECRET_KEY="-1" \
S3_BUCKET_NAME="-1" \
POSTGRES_ENDPOINT="-1" \
POSTGRES_USER="-1" \
POSTGRES_PASSWORD="-1" \
POSTGRES_DB="-1"
#-----------------Development-----------------------
FROM base as development
VOLUME $HOME/packages
VOLUME $HOME/scripts
VOLUME $HOME/services/storage/client-sdk
VOLUME $HOME/raw
VOLUME $HOME/docker
VOLUME $HOME/inputs
VOLUME $HOME/server
VOLUME $HOME/devel
COPY --chown=scu /scripts/dy_services_helpers/requirements.txt $HOME/scripts/dy_services_helpers/requirements.txt
RUN pip3 install -r $HOME/scripts/dy_services_helpers/requirements.txt
ENV CREATE_DUMMY_TABLE 1
ENV USE_CASE_CONFIG_FILE="/home/scu/devel/port_config.json"
ENV INIT_OPTIONS="50 6 1 tab"
WORKDIR $HOME/raw
ENTRYPOINT ["/bin/bash", "../docker/boot.sh"]
#-----------------Production----------------------
FROM base AS production
# install simcore packages
COPY packages/simcore-sdk $HOME/packages/simcore-sdk
COPY packages/s3wrapper $HOME/packages/s3wrapper
COPY services/storage/client-sdk $HOME/services/storage/client-sdk
# install packages but beware we need to use python 3.6 through pyenv
RUN pip3 install $HOME/packages/simcore-sdk &&\
pip3 install $HOME/packages/s3wrapper && \
pip3 install $HOME/services/storage/client-sdk/python
ARG BRANCH_NAME
RUN git clone https://github.com/ITISFoundation/raw.git --branch ${BRANCH_NAME}
WORKDIR $HOME/raw
RUN npm install -g bower
RUN bower install --force --allow-root
WORKDIR $HOME
COPY --chown=scu:scu services/dy-raw-graphs/docker $HOME/docker
COPY --chown=scu:scu services/dy-raw-graphs/server $HOME/server
WORKDIR $HOME/raw
CMD ["/bin/bash", "../docker/boot.sh"]