-
-
Notifications
You must be signed in to change notification settings - Fork 919
/
Copy pathDockerfile.monitoring
39 lines (26 loc) · 1.09 KB
/
Dockerfile.monitoring
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
FROM node:18-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=./apps/monitoring install --frozen-lockfile
# Deploy only the monitoring app
ENV NODE_ENV=production
RUN pnpm --filter=./apps/monitoring run build
RUN pnpm --filter=./apps/monitoring --prod deploy /prod/monitoring
RUN cp -R /usr/src/app/apps/monitoring/dist /prod/monitoring/dist
FROM base AS dokploy
WORKDIR /app
# Set production
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh
# Copy only the necessary files
COPY --from=build /prod/monitoring/dist ./dist
COPY --from=build /prod/monitoring/package.json ./package.json
COPY --from=build /prod/monitoring/node_modules ./node_modules
CMD HOSTNAME=0.0.0.0 && pnpm start