|
|
|
FROM node:20-alpine as builder |
|
|
|
|
|
|
|
RUN apk add --no-cache git && \ |
|
git clone https://github.com/louislam/uptime-kuma.git /app |
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY package*.json ./ |
|
|
|
|
|
RUN npm install --legacy-peer-deps && npm cache clean --force |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN npm run build |
|
|
|
|
|
RUN npm prune --production |
|
|
|
|
|
FROM node:20-alpine |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --from=builder /app/dist ./dist |
|
COPY --from=builder /app/server ./server |
|
COPY --from=builder /app/node_modules ./node_modules |
|
COPY --from=builder /app/package*.json ./ |
|
COPY --from=builder /app/src ./src |
|
|
|
COPY --from=builder /app/db ./db |
|
|
|
RUN mkdir -p /app/data && chown -R node:node /app |
|
|
|
USER node |
|
|
|
|
|
EXPOSE 3001 |
|
|
|
|
|
CMD ["node", "server/server.js"] |