meshtastic-map/Dockerfile
Jellyfrog 7d63cac3b9 Optimize Dockerfile with multi-stage build
Also:
* Skips installing dev dependencies
* Runs as non root
2025-09-28 18:49:36 +02:00

24 lines
No EOL
418 B
Docker

FROM node:lts-alpine AS build
WORKDIR /app
# Copy only package files and install deps
# This layer will be cached as long as package*.json don't change
COPY package*.json package-lock.json* ./
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
# Copy the rest of your source
COPY . .
FROM node:lts-alpine
RUN apk add --no-cache openssl
USER node:node
WORKDIR /app
COPY --from=build /app .
EXPOSE 8080