-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
53 lines (35 loc) · 1.04 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
FROM node:current-alpine as deps
WORKDIR /app
RUN apk add python3 g++ make
COPY package.json .
COPY package-lock.json .
RUN npm i \
&& mv ./node_modules/@types/jsonstream ./node_modules/@types/JSONStream
FROM deps as frontend
WORKDIR /app
COPY public ./public
COPY src ./src
COPY plugins ./plugins
COPY types ./types
COPY Shared ./Shared
COPY .browserslistrc tsconfig.json tslint.json vue.config.js ./
COPY .eslintrc.js ./
RUN npm run build-frontend
FROM deps as backend
WORKDIR /app
COPY backend ./backend
COPY Shared ./Shared
RUN npm run build-backend
FROM node:current-alpine
WORKDIR /app
RUN apk add git ffmpeg
COPY --from=deps /app/node_modules node_modules
COPY --from=deps /app/package.json .
COPY --from=frontend /app/client client
COPY --from=backend /app/backend/build .
COPY --from=backend /app/backend/tsconfig.json ./backend
COPY .git ./.git
RUN echo "window.build=\"$(git rev-parse HEAD | cut -c 1-7)_$(date +'%d.%m.%Y')_$(date +"%T")\";" > /app/client/env.js \
&& rm -rf .git
EXPOSE 80 443
ENTRYPOINT [ "npm", "start" ]