wip(ci): docker dev and prod build + ci

This commit is contained in:
yassin@siouda.com
2023-10-11 16:58:00 +02:00
parent 4fdfdbe89f
commit cfac5b116e
4 changed files with 81 additions and 2 deletions

28
Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM node:lts-alpine as dev
WORKDIR /app
COPY ./ /app
# install dependencies
RUN yarn install
# Run dev
ENTRYPOINT [ "yarn", "run", "dev" ]
FROM node:lts-alpine as build
WORKDIR /app
# copy node modules from dev stage
COPY --from=dev /app/ /app/
# build
RUN yarn run build
FROM nginx:alpine as prod
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]