em-shop/history/Dockerfile
2024-11-20 09:53:03 +05:00

24 lines
517 B
Docker
Executable File

# develop stage
FROM node:22.11.0-alpine3.20 AS develop-stage
WORKDIR /app
COPY package*.json ./
RUN npm config set fund false --location=global
COPY . .
# build stage
FROM develop-stage AS build-stage
RUN npm install
RUN npm run build
# production stage
FROM node:22.11.0-alpine3.20 AS production-stage
WORKDIR /app
COPY --from=build-stage /app/node_modules /app/node_modules
COPY --from=build-stage /app/dist /app/dist
COPY package.json ./
ENV NODE_PATH=./node_modules
CMD ["node", "dist/index.js"]
EXPOSE 3002