-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (24 loc) · 717 Bytes
/
Dockerfile
File metadata and controls
41 lines (24 loc) · 717 Bytes
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
# build step frontend
FROM node:16-alpine as builder-frontend
WORKDIR /usr/src/app
COPY lib lib
COPY frontend frontend
COPY frontend/.env* frontend/
WORKDIR /usr/src/app/frontend
RUN npm ci
ARG VITE_MODE=development
RUN npx vue-tsc --noEmit && npx vite build --mode $VITE_MODE
# build step backend
FROM node:16-alpine as builder-backend
WORKDIR /usr/src/app
COPY server/ .
RUN npm ci
RUN npm run build
# build final container
FROM node:16-alpine
WORKDIR /usr/src/app
COPY --from=builder-backend /usr/src/app/dist/ dist/
COPY --from=builder-backend /usr/src/app/node_modules/ node_modules/
COPY --from=builder-frontend /usr/src/app/frontend/dist/ public/
EXPOSE 5000
CMD [ "node", "dist/server.js" ]