feat: add Dockerfile with Node 18 Alpine, non-root user, health check

This commit is contained in:
2026-05-19 14:24:55 +10:00
parent 264fe129f5
commit ea3afb772e
+30
View File
@@ -0,0 +1,30 @@
FROM node:18-alpine
LABEL maintainer="ImmichFrame"
LABEL description="Lightweight digital photo frame for Immich"
WORKDIR /app
# Copy package files first for better caching
COPY package.json ./
# Install dependencies
RUN npm install --production && npm cache clean --force
# Copy application
COPY server.js ./
COPY public/ ./public/
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:3000/api/config || exit 1
# Run as non-root
RUN addgroup -g 1001 -S appgroup && \
adduser -S appuser -u 1001 -G appgroup
USER appuser
CMD ["node", "server.js"]