mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-02 21:13:45 +00:00
The workspace package-lock.json had corrupted 'resolved' URLs for many packages including string_decoder, causing Docker builds to fail with 404 errors. Changes: - Regenerated root package-lock.json which manages all workspace dependencies - Restored npm ci in Dockerfile (now that lockfile is fixed) - Keep PRISMA_CLI_BINARY_TYPE=binary for ARM64 compatibility This should resolve both AMD64 and ARM64 Docker build failures.
92 lines
2.2 KiB
Docker
92 lines
2.2 KiB
Docker
# Development target
|
|
FROM node:lts-alpine AS development
|
|
|
|
ENV NODE_ENV=development \
|
|
NPM_CONFIG_UPDATE_NOTIFIER=false \
|
|
ENABLE_LOGGING=true \
|
|
LOG_LEVEL=info \
|
|
PM_LOG_TO_CONSOLE=true \
|
|
PORT=3001
|
|
|
|
RUN apk add --no-cache openssl tini curl libc6-compat
|
|
|
|
USER node
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --chown=node:node package*.json ./
|
|
COPY --chown=node:node backend/ ./backend/
|
|
COPY --chown=node:node agents ./agents_backup
|
|
COPY --chown=node:node agents ./agents
|
|
COPY --chmod=755 docker/backend.docker-entrypoint.sh ./entrypoint.sh
|
|
|
|
WORKDIR /app/backend
|
|
|
|
RUN npm ci --ignore-scripts && npx prisma generate
|
|
|
|
EXPOSE 3001
|
|
|
|
VOLUME [ "/app/agents" ]
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=5 \
|
|
CMD curl -f http://localhost:3001/health || exit 1
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
CMD ["/app/entrypoint.sh"]
|
|
|
|
# Builder stage for production
|
|
FROM node:lts-alpine AS builder
|
|
|
|
RUN apk add --no-cache openssl
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --chown=node:node package*.json ./
|
|
COPY --chown=node:node backend/ ./backend/
|
|
|
|
WORKDIR /app/backend
|
|
|
|
RUN npm cache clean --force &&\
|
|
rm -rf node_modules ~/.npm /root/.npm &&\
|
|
npm ci --ignore-scripts --legacy-peer-deps --no-audit --prefer-online --fetch-retries=0 &&\
|
|
PRISMA_CLI_BINARY_TYPE=binary npm run db:generate &&\
|
|
npm prune --omit=dev &&\
|
|
npm cache clean --force
|
|
|
|
# Production stage
|
|
FROM node:lts-alpine
|
|
|
|
ENV NODE_ENV=production \
|
|
NPM_CONFIG_UPDATE_NOTIFIER=false \
|
|
ENABLE_LOGGING=true \
|
|
LOG_LEVEL=info \
|
|
PM_LOG_TO_CONSOLE=true \
|
|
PORT=3001 \
|
|
JWT_EXPIRES_IN=1h \
|
|
JWT_REFRESH_EXPIRES_IN=7d \
|
|
SESSION_INACTIVITY_TIMEOUT_MINUTES=30
|
|
|
|
RUN apk add --no-cache openssl tini curl libc6-compat
|
|
|
|
USER node
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/backend ./backend
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --chown=node:node agents ./agents_backup
|
|
COPY --chown=node:node agents ./agents
|
|
COPY --chmod=755 docker/backend.docker-entrypoint.sh ./entrypoint.sh
|
|
|
|
WORKDIR /app/backend
|
|
|
|
EXPOSE 3001
|
|
|
|
VOLUME [ "/app/agents" ]
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=5 \
|
|
CMD curl -f http://localhost:3001/health || exit 1
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
CMD ["/app/entrypoint.sh"]
|