23 lines
496 B
Docker
Executable File
23 lines
496 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
|
|
|
|
|
|
# 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/src /app/src
|
|
COPY package.json ./
|
|
ENV NODE_PATH=./node_modules
|
|
CMD ["node", "src/index.js"]
|
|
EXPOSE 3001
|