From 6212a43d852d58e0375a3867c7385fc8e8a0029a Mon Sep 17 00:00:00 2001 From: Cristina Popescu Date: Sun, 18 Jul 2021 21:09:22 +0300 Subject: [PATCH] added Dockerfile, .dockerignore and docker-compose.yml --- .dockerignore | 6 ++++++ Dockerfile | 34 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 14 ++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..92a9579 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +build +.dockerignore +Dockerfile +Dockerfile.prod + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..94d9c0a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM node:14-alpine as build + + +LABEL description="This the base Docker image for GDSC UPT Admin Dasboard React app" + + +ARG BRANCH=main + + +RUN mkdir /gdsc-admin-dashboard + +WORKDIR /gdsc-admin-dashboard + +ENV PATH /gdsc-admin-dashboard/node_modules/.bin:$PATH + + +# install app dependencies + +COPY ["package.json", "yarn.lock", "./"] + +RUN yarn + + +# add app + +COPY . ./ + +#RUN yarn run build:$BRANCH --main + +EXPOSE 3000 + +# start app + +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3090726 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.1" + + +services: + dashboard: + build: + context: . + dockerfile: ./Dockerfile + args: + - BRANCH=main + image: "gdsc-admin-dashboard" + ports: + - "3000:3000" + command: yarn start