diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..143d67b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# docker files +Dockerfile +docker-compose.yml + +# git files +branches +config +descriptiom +HEAD +hooks +info +objects +refs \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6a91fcd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# 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 +# use custom error code websites instead +RUN rm -f /usr/share/nginx/html/50x.html +# update default.conf nginx file with necessary try_files statement +RUN rm -f /etc/nginx/conf.d/default.conf +COPY ./default.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..18e6d43 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +networks: + openvisorwebsite-network: + name: openvisorwebsite-network + driver: bridge + external: false + attachable: false + +services: + openvisorwebsite-app: + container_name: openvisorwebsite-app + build: . + ports: + - 1443:80 + networks: + - openvisorwebsite-network \ No newline at end of file