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