mirror of
https://github.com/thelegendtubaguy/ArrQueueCleaner.git
synced 2026-01-24 19:09:20 -06:00
34 lines
717 B
Docker
34 lines
717 B
Docker
FROM node:22-alpine
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S nodejs && \
|
|
adduser -S appuser -u 1001 -G nodejs
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy source and build
|
|
COPY tsconfig.json ./
|
|
COPY src/ ./src/
|
|
RUN pnpm build
|
|
|
|
# Remove dev dependencies and clean up
|
|
RUN pnpm prune --prod && \
|
|
rm -rf src/ tsconfig.json && \
|
|
npm cache clean --force
|
|
|
|
# Change ownership and switch to non-root user
|
|
RUN chown -R appuser:nodejs /app
|
|
USER appuser
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD node -e "console.log('healthy')" || exit 1
|
|
|
|
CMD ["pnpm", "start"]
|