dev1/Dockerfile.common

22 lines
486 B
Docker

# ---------- minimal Node runtime ----------
FROM node:20-slim
# 1. safe work dir
WORKDIR /app
# 2. install prod deps only
COPY package*.json ./
RUN apt-get update -y && apt-get install -y --no-install-recommends build-essential python3 make g++ && rm -rf /var/lib/apt/lists/*
RUN npm ci --omit=dev --ignore-scripts
# 3. copy source
COPY . .
# 4. expose port placeholder (overridden in child files)
ARG APPPORT=5000
ENV PORT=$APPPORT
EXPOSE $APPPORT
# 5. start
CMD ["npm","start"]