-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile.devvm
44 lines (35 loc) · 1.19 KB
/
Dockerfile.devvm
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
# build stage
FROM node:16-alpine as build-stage
RUN apk add --no-cache git
RUN apk add --no-cache bash
RUN apk add --no-cache make gcc g++ python2 pkgconfig pixman-dev cairo-dev pango-dev libjpeg-turbo-dev giflib-dev
RUN mkdir /ui
COPY ./ /ui/
WORKDIR /ui
RUN HUSKY=0 npm ci
RUN npm run build:vm
# run stage
FROM node:16-alpine as run-stage
RUN apk add --no-cache git
RUN apk add --no-cache tini
RUN apk add --no-cache make gcc g++ python2 pkgconfig pixman-dev cairo-dev pango-dev libjpeg-turbo-dev giflib-dev
# Use Tini for entrypoint, available at /sbin/tini
# NOTE: Overridden when starting K8s pods
ENTRYPOINT ["/sbin/tini", "--"]
# Change working directory
RUN mkdir /ui
WORKDIR /ui
# Bring over app files
COPY --from=build-stage /ui/build ./build
COPY --from=build-stage /ui/config ./config
COPY --from=build-stage /ui/dist ./dist
COPY --from=build-stage /ui/server ./server
COPY --from=build-stage /ui/src ./src
COPY --from=build-stage /ui/package.json .
COPY --from=build-stage /ui/package-lock.json .
# Install PROD dependencies only
RUN HUSKY=0 NODE_ENV=production npm ci
# Expose API port to the outside
EXPOSE 8888
# Launch application
CMD ["npm","run","start","--","--config=dev-vm-docker"]