my-portfolio/Dockerfile

22 lines
368 B
Docker
Raw Normal View History

FROM node:18-alpine AS builder
RUN mkdir /app
WORKDIR /app
2024-04-26 17:30:48 +02:00
COPY . /app
2024-04-26 17:30:48 +02:00
RUN cd /app && yarn install && yarn build
2024-04-13 23:34:10 +02:00
FROM node:18-alpine
2024-04-26 17:30:48 +02:00
RUN mkdir /app
2024-04-26 17:30:48 +02:00
COPY --from=builder /app/build /app/build
COPY --from=builder /app/package.json /app/yarn.lock /app/
2024-04-13 23:34:10 +02:00
RUN cd /app && \
yarn install --production &&\
yarn cache clean
2024-04-26 17:30:48 +02:00
WORKDIR /app
2024-04-26 17:30:48 +02:00
CMD ["node", "build/index.js"]