From ea3afb772e14802f15abd6b5953367b49beb6870 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 19 May 2026 14:24:55 +1000 Subject: [PATCH] feat: add Dockerfile with Node 18 Alpine, non-root user, health check --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d7ea185 --- /dev/null +++ b/Dockerfile @@ -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"]