-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
44 lines (27 loc) · 799 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
41
42
43
44
ARG NODE_VERSION="iron"
ARG ALPINE_VERSION="3.20"
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS node_base
FROM node_base AS builder_base
RUN npm install pnpm@9 -g
# BUILDER
FROM builder_base AS builder
WORKDIR /app
COPY ./pnpm-lock.yaml ./
RUN pnpm fetch
COPY ./package.json ./
RUN pnpm install -r --prefer-offline
COPY ./app ./app
COPY ./tsconfig.json ./tsconfig.json
COPY ./vite.config.ts ./vite.config.ts
COPY ./tailwind.config.ts ./tailwind.config.ts
COPY ./postcss.config.js ./postcss.config.js
COPY ./components.json ./components.json
RUN pnpm build
FROM node_base AS app
ENV NODE_ENV production
WORKDIR /app
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./package.json
RUN npm install --omit=dev
EXPOSE 3000
CMD ["npm", "run", "start"]