-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-server
46 lines (25 loc) · 1.02 KB
/
Dockerfile-server
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
FROM node:16.13.1-alpine as server_dist
WORKDIR /server_dist
# Only copy over the packages files of all required packages.
# This will ensure that we don't have to install all dependencies
# again if any source files change.
COPY package*.json lerna.json tsconfig.json ./
COPY packages/server/package*.json ./packages/server/
# Install dependencies and bootstrap packages
RUN npm ci --unsafe-perm
# Now copy over source files and assets
COPY packages/server/src ./packages/server/src
COPY packages/server/tsconfig.json ./packages/server/
COPY packages/server/webpack.config.js ./packages/server/webpack.config.js
RUN npm run server:build
FROM node:16.13.1 as server_dist2
WORKDIR /server_dist2/packages/server
COPY --from=server_dist /server_dist/packages/server/dist/package\*.json .
RUN npm install
COPY --from=server_dist /server_dist/packages/server/dist/ .
FROM node:16.13.1-buster-slim
EXPOSE 3020
WORKDIR /desktop
COPY --from=server_dist2 /server_dist2/packages/server/ .
ENTRYPOINT ["npm", "run"]
CMD [ "server"]