# syntax=docker/dockerfile:1.6

ARG NODE_VERSION=20

FROM node:${NODE_VERSION}-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .

FROM base AS dev
ENV NODE_ENV=development
EXPOSE 4000
CMD ["npm", "run", "dev"]

FROM base AS prod
ENV NODE_ENV=production
EXPOSE 4000
CMD ["node", "index.js"]
