Reduce image size by switching to alpine and excluding folders from being copied into the image

This commit is contained in:
schlagmichdoch 2024-07-14 14:06:40 +02:00
parent 331c61fec8
commit 10f648b7cd
2 changed files with 15 additions and 5 deletions

View file

@ -1,11 +1,13 @@
FROM node:lts-alpine
FROM alpine:latest
WORKDIR /home/node/app
COPY package*.json ./
RUN npm ci
RUN apk add --no-cache nodejs npm
RUN NODE_ENV="production" npm ci --omit=dev
# Directories and files excluded via .dockerignore
COPY . .
# environment settings