lottis_imagen/web/Dockerfile

32 lines
505 B
Docker
Raw Permalink Normal View History

2024-05-01 14:50:42 +00:00
FROM node:18-alpine AS build
#### RUN BUILD IN CONTAINER
# copy required files
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
# copy to actual container (prod)
FROM node:18-alpine AS web
WORKDIR /app
# copy required files
COPY --from=build /app/build /app/build
# COPY --from=build /app/migrations /app/migrations
COPY --from=build /app/package.json /app/package-lock.json .
# get production node modules
RUN npm ci --omit dev
# expose port
EXPOSE 3000
# run app
CMD ["node", "build"]