forked from Open-MBEE/mcf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
65 lines (48 loc) · 1.67 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
FROM registry.access.redhat.com/ubi7/ubi
WORKDIR /opt/mbee
# Create mbee user and run mcf under that context
RUN groupadd -r mcf -g 1020 \
&& useradd -u 1020 -r -g mcf -m -d /opt/mbee -s /sbin/nologin -c "MCF user" mcf
ENV MBEE_ENV=default \
NODE_ENV=development
# Copy Project
COPY . ./
# Create log and artifact project directories
RUN mkdir logs \
&& mkdir -p data/artifacts \
&& mkdir -p all_plugins
COPY ./plugins all_plugins
# Change permission on entrypoint and mbee directory
RUN chmod +x ./docker-entrypoint.sh \
&& chmod 755 /opt/mbee \
&& chown -R mcf:mcf /opt/mbee
# Install wget and git
RUN yum install -y wget git
# Install Prince
RUN curl -kL -o ./prince-13.5-1.centos7.x86_64.rpm \
https://www.princexml.com/download/prince-13.5-1.centos7.x86_64.rpm \
&& yum install -y ./prince-13.5-1.centos7.x86_64.rpm \
&& rm prince-13.5-1.centos7.x86_64.rpm
# Install NodeJS 12
RUN wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.gz --no-check-certificate \
&& tar --strip-components 1 -xzvf node-v* -C /usr/local
# Init git configuration
RUN git init \
&& git config user.email "example@example.com" \
&& git config user.name "MBEE Container Runtime" \
&& git add . \
&& git commit -m "Initialize Container" -q
# Install yarn
RUN npm install -g yarn
# Update permissions and install plugin dependencies
RUN chmod +x ./scripts/install-plugin-modules.sh \
&& ./scripts/install-plugin-modules.sh
# Init mcf user
USER mcf
# Install yarn packages
RUN NOPOSTINSTALL=1 NOPREINSTALL=1 yarn install
VOLUME all_plugins
EXPOSE 9080 9443
# Run server
ENTRYPOINT ["/opt/mbee/docker-entrypoint.sh"]
CMD ["node","mbee","start"]