From e4705893a9ebedfbf6cd010c57cd664a54a1b9e2 Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Sat, 28 Nov 2020 21:45:37 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20Add=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/Dockerfile | 13 +++++++++++++ web/web.sh | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 web/Dockerfile create mode 100644 web/web.sh diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..97380b9 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,13 @@ +# build stage +FROM node:lts-alpine as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +# production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/web/web.sh b/web/web.sh new file mode 100644 index 0000000..fef8426 --- /dev/null +++ b/web/web.sh @@ -0,0 +1,2 @@ +docker build -t xrazis/web . +docker run -d -p 8090:80 xrazis/web \ No newline at end of file