-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 774 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 774 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
34
FROM node:22-bookworm AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
ARG APP_DIR
RUN apt update && \
apt install -y git
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm build
RUN pnpm --filter=forms-$APP_DIR --prod deploy /app/$APP_DIR
FROM base AS app
ARG APP_DIR
LABEL org.opencontainers.image.description 10x Forms Platform
COPY --from=build /app/$APP_DIR /app/$APP_DIR
COPY --from=build /usr/src/app/apps/$APP_DIR/dist /app/$APP_DIR/dist
WORKDIR /app/$APP_DIR
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
CMD [ "node", "./dist/index.js" ]
#HEALTHCHECK --interval=5m --timeout=3s \
# CMD curl -f http://localhost:4321/ || exit 1