2024-05-11 11:13:41 +00:00
|
|
|
# PHASE 1: copy and build
|
|
|
|
|
2024-05-19 09:11:12 +00:00
|
|
|
FROM node:22.2.0-alpine3.19 AS build
|
2024-04-27 18:30:38 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2024-05-11 11:13:41 +00:00
|
|
|
RUN rm -rf node_modules && npm install && npm run build
|
|
|
|
|
|
|
|
# PHASE 2: prepare for exec
|
2024-04-27 18:30:38 +00:00
|
|
|
|
2024-05-19 09:11:12 +00:00
|
|
|
FROM node:22.2.0-alpine3.19 AS exec
|
2024-05-11 11:13:41 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
2024-04-27 18:30:38 +00:00
|
|
|
|
2024-05-11 11:13:41 +00:00
|
|
|
COPY --from=build /app/. .
|
2024-04-27 18:30:38 +00:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["npm", "run", "start"]
|