-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 958 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 958 Bytes
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
FROM node:24-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# deps/build
FROM base AS builder
COPY . .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
ENV NEXT_TELEMETRY_DISABLED=1
# build ensadmin with static export
RUN pnpm --filter ensadmin build
# runner - use nginx to serve static files
FROM nginx:alpine AS runner
# Copy the static export output
COPY --from=builder /app/apps/ensadmin/out /usr/share/nginx/html
# Replace default nginx configuration with our own
RUN rm -f /etc/nginx/conf.d/default.conf.default
COPY --from=builder /app/apps/ensadmin/nginx.conf /etc/nginx/conf.d/default.conf
# Include custom docker-entrypoint.sh for generating runtime-config
COPY --from=builder /app/apps/ensadmin/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 4173
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]