-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (49 loc) · 1.55 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (49 loc) · 1.55 KB
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
ARG BASE_IMAGE="node:24-slim"
FROM $BASE_IMAGE AS node-base
FROM node-base AS build-packages
RUN mkdir /packages
WORKDIR /mage-server
COPY ./ ./
RUN cd service \
&& npm ci \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/service
RUN cd web-app \
&& npm ci \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/web-app/dist/app \
&& npm pack /mage-server/web-app/dist/core-lib
RUN cd plugins/image/service \
&& npm link ../../../service \
&& npm run build && \
cd /packages \
&& npm pack /mage-server/plugins/image/service
RUN cd plugins/sftp/service \
&& npm link ../../../service \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/plugins/sftp/service
RUN cd plugins/sftp/web \
&& npm link ../../../web-app/dist/core-lib \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/plugins/sftp/web/dist/main
RUN cd plugins/arcgis/service \
&& npm link ../../../service \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/plugins/arcgis/service
RUN cd plugins/arcgis/web-app \
&& npm link ../../../web-app/dist/core-lib \
&& npm run build \
&& cd /packages \
&& npm pack /mage-server/plugins/arcgis/web-app/dist/main
FROM node-base AS build-instance
ENV MAGE_HOME=/home/mage/instance
WORKDIR ${MAGE_HOME}
COPY --from=build-packages /packages ${MAGE_HOME}/packages/
RUN npm install --force --omit dev ${MAGE_HOME}/packages/*.tgz
RUN ln -s ./node_modules/.bin/mage.service
ENTRYPOINT [ "./mage.service" ]