diff --git a/.github/workflows/build_docker_container.yaml b/.github/workflows/build_docker_container.yaml new file mode 100644 index 0000000..9835f1e --- /dev/null +++ b/.github/workflows/build_docker_container.yaml @@ -0,0 +1,12 @@ +name: "build feature branch" +on: [ push ] +jobs: + "Build_Docker_Container": + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build container + run: docker buildx build -t react-open-arch . \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..95bf2c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:20-alpine as builder + +WORKDIR /app + +COPY . . + +RUN ["npm", "ci"] +RUN ["npm", "run", "build"] + +FROM nginx:stable as nginx +WORKDIR /app +COPY --from=builder /app/dist ./static/ +COPY ./nginx.conf /etc/nginx/nginx.conf + +EXPOSE 8080 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..d84cb01 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,22 @@ +events { + worker_connections 1024; +} + +http { + include mime.types; + sendfile on; + + server { + listen 8080; + listen [::]:8080; + + resolver 127.0.0.11; + autoindex off; + + server_name _; + server_tokens off; + + root /app/static; + gzip_static on; + } +} \ No newline at end of file