forked from soumitradev/chrono-temp-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 957 Bytes
/
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
FROM node:18.16.0-slim AS build-stage
ENV NODE_ENV production
WORKDIR /usr/src/app
ENV PNPM_HOME="/root/.local/share/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"
COPY --chown=node:node tsconfig.json ./
COPY --chown=node:node tsconfig.node.json ./
COPY --chown=node:node .env* ./
COPY --chown=node:node public ./
COPY --chown=node:node postcss.config.js ./
COPY --chown=node:node tailwind.config.cjs ./
COPY --chown=node:node vite.config.ts ./
COPY --chown=node:node CDCs.json ./
COPY --chown=node:node components.json ./
COPY --chown=node:node index.html ./
RUN npm install -g pnpm
COPY package.json ./
COPY pnpm-lock.yaml ./
RUN pnpm fetch --prod
RUN pnpm install -r --offline --prod
COPY --chown=node:node src ./src
RUN pnpm run build
FROM nginx:1.25.1-alpine
WORKDIR /usr/share/nginx/html
RUN mkdir /usr/log
RUN rm -rf ./*
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /usr/src/app/dist .
CMD ["nginx", "-g", "daemon off;"]