forked from nktnet1/rt-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (31 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
53 lines (31 loc) · 1.23 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
FROM node:24-alpine AS base
ENV NODE_ENV=production
WORKDIR /app
# =========================================================================== #
FROM base AS builder-base
ENV TURBO_TELEMETRY_DISABLED=1
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI=1
RUN corepack enable pnpm
# =========================================================================== #
FROM builder-base AS builder
RUN pnpm install --global turbo@^2
COPY . .
# https://turbo.build/repo/docs/guides/tools/docker#the-solution
RUN turbo prune server --docker
# =========================================================================== #
FROM builder-base AS installer
COPY --from=builder /app/out/json/ .
RUN pnpm install --frozen-lockfile
COPY --from=builder /app/out/full/ .
RUN pnpm --filter=server build
# =========================================================================== #
FROM base AS production
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 hono
COPY --from=installer --chown=hono:nodejs /app/apps/server/dist /app/dist
USER hono
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD wget --quiet --spider http://${SERVER_HOST}:${SERVER_PORT}/healthcheck || exit 1
CMD ["node", "/app/dist/server.mjs"]