-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
32 lines (29 loc) · 811 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
FROM node:20 AS base
ARG GIT_TAG
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
RUN if [ -n "$GIT_TAG" ]; then \
VERSION="$GIT_TAG ($(git rev-parse --short HEAD))"; \
else \
VERSION="$(git describe --tags --abbrev=0) ($(git rev-parse --short HEAD))"; \
fi && \
echo $VERSION > .git-rev
RUN rm -rf .git
FROM base AS prod-deps
RUN pnpm install --prod --frozen-lockfile
FROM base AS build
RUN pnpm install --frozen-lockfile
RUN pnpm run tailwind:build
RUN pnpm run generate
RUN pnpm run build
FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/.git-rev /app/dist/.git-rev
ENV NODE_ENV=production
EXPOSE 3000
ENV ADDRESS=0.0.0.0 PORT=3000
CMD [ "pnpm", "start" ]