-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
49 lines (30 loc) · 1.1 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
38
39
40
41
42
43
44
45
46
47
48
49
FROM node:22-alpine AS base
WORKDIR /app
ENV NODE_ENV=production
ENV TURBO_TELEMETRY_DISABLED=1
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI=1
RUN corepack enable pnpm
# =========================================================================== #
FROM base AS builder
RUN pnpm install --global turbo@^2
COPY . .
# https://turbo.build/repo/docs/guides/tools/docker#the-solution
RUN turbo prune web --docker
# =========================================================================== #
FROM base AS installer
ARG PUBLIC_SERVER_URL
ENV PUBLIC_SERVER_URL=${PUBLIC_SERVER_URL}
COPY --from=builder /app/out/json/ .
RUN pnpm install --frozen-lockfile
COPY --from=builder /app/out/full/ .
RUN pnpm build
# =========================================================================== #
FROM nginx:stable-alpine AS production
WORKDIR /app
COPY apps/web/nginx.conf /etc/nginx/nginx.conf
COPY --from=installer /app/apps/web/dist /usr/share/nginx/html
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl --fail --silent http://0.0.0.0:80/healthcheck || exit 1
CMD ["nginx", "-g", "daemon off;"]