-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (36 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (36 loc) · 1.32 KB
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
50
51
52
53
54
55
56
FROM node:24-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
COPY . .
RUN pnpm dlx turbo prune web --docker
# =========================================================================== #
FROM base AS installer
ARG PUBLIC_SERVER_URL
ENV PUBLIC_SERVER_URL=${PUBLIC_SERVER_URL}
ARG PUBLIC_SERVER_API_PATH=/api
ENV PUBLIC_SERVER_API_PATH=${PUBLIC_SERVER_API_PATH}
ARG PUBLIC_BASE_PATH=/
ENV PUBLIC_BASE_PATH=${PUBLIC_BASE_PATH}
COPY --from=builder /app/out/json/ .
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
COPY --from=builder /app/out/full/ .
RUN pnpm build && \
cd apps/web && \
node scripts/prepare-serve.ts && \
rm -f dist/.serve-base-path
# =========================================================================== #
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;"]