-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
37 lines (35 loc) · 1.06 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
FROM node:20 AS backend_build_image
WORKDIR /app/backend
COPY backend/package-lock.json .
COPY backend/package.json .
RUN npm ci
COPY common ../common
COPY backend/src src
COPY backend/tsconfig.json .
COPY backend/tsoa.json .
RUN npm run build
RUN npm prune --production
FROM node:20 AS frontend_build_image
WORKDIR /app/frontend
COPY frontend/package-lock.json .
COPY frontend/package.json .
RUN npm ci
COPY common ../common
COPY frontend/src src
COPY frontend/index.html .
COPY frontend/postcss.config.js .
COPY frontend/tailwind.config.js .
COPY frontend/tsconfig.json .
COPY frontend/vite.config.mts .
RUN npm run build
FROM node:20
COPY --from=backend_build_image /app/backend/package.json /app/backend/swagger.json /app/backend/
COPY --from=backend_build_image /app/backend/dist /app/backend/dist
COPY --from=backend_build_image /app/backend/node_modules /app/backend/node_modules
COPY --from=frontend_build_image /app/frontend/dist /app/frontend/dist
VOLUME /app/backend/storage
EXPOSE 8080
ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}
WORKDIR /app/backend
CMD ["npm", "start"]