Files
Jannik 2475176949
Build and Push Docker Image / build-and-push (push) Canceled after 0s
fix(docker): run container as non-root appuser
2026-11-19 17:48:43 +01:00

24 lines
387 B
Docker

FROM node:24-alpine
WORKDIR /app
# Install dependencies first (caching)
COPY package*.json ./
RUN npm install
# Copy source code and frontend
COPY . .
# Build typescript
RUN npm run build
RUN addgroup -S appgroup && adduser -S appuser -G appgroup \
&& mkdir -p /home/appuser \
&& chown -R appuser:appgroup /app /home/appuser
EXPOSE 3000
USER appuser
CMD ["npm", "start"]