-
Notifications
You must be signed in to change notification settings - Fork 70
/
Dockerfile
43 lines (29 loc) · 1.02 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
FROM node:18 as builder
# 用户工作空间,用于打包到前端工作空间地址
ENV WORKSPACE_DIR workspace
ENV EXTENSION_DIR extensions
COPY . .
ENV ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/
RUN mkdir -p ${WORKSPACE_DIR} &&\
mkdir -p ${EXTENSION_DIR}
RUN yarn --ignore-scripts --network-timeout 1000000 && \
yarn run build && \
yarn run download:extensions && \
rm -rf ./node_modules
FROM node:18 as app
ENV WORKSPACE_DIR /workspace
ENV EXTENSION_DIR /root/.sumi/extensions
ENV EXT_MODE js
ENV NODE_ENV production
RUN mkdir -p ${WORKSPACE_DIR} &&\
mkdir -p ${EXTENSION_DIR}
WORKDIR /release
COPY ./configs/docker/productionDependencies.json package.json
RUN yarn config set -H npmRegistryServer "https://registry.npmmirror.com" && \
yarn --network-timeout 1000000
COPY --from=builder dist dist
COPY --from=builder dist-node dist-node
COPY --from=builder hosted hosted
COPY --from=builder extensions /root/.sumi/extensions
EXPOSE 8000
CMD [ "node", "./dist-node/server/index.js" ]