From 0de24c41ed7335fdddb090b5e75777c33eef0cf5 Mon Sep 17 00:00:00 2001 From: Dan Ditomaso Date: Sat, 29 Mar 2025 15:54:15 -0400 Subject: [PATCH] fix: docker build process --- .dockerignore | 2 -- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- Containerfile | 10 --------- infra/.dockerignore | 2 ++ infra/Containerfile | 15 +++++++++++++ infra/default.conf | 42 +++++++++++++++++++++++++++++++++++ 7 files changed, 61 insertions(+), 14 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Containerfile create mode 100644 infra/.dockerignore create mode 100644 infra/Containerfile create mode 100644 infra/default.conf diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c61e351e..00000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/build.tar -dist/output diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b631af55..56fce979 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -46,7 +46,7 @@ jobs: uses: redhat-actions/buildah-build@v2 with: containerfiles: | - ./Containerfile + ./infra/Containerfile image: ${{github.event.repository.full_name}} tags: nightly ${{ github.sha }} oci: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 580dc7c2..c3109a69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: uses: redhat-actions/buildah-build@v2 with: containerfiles: | - ./Containerfile + ./infra/Containerfile image: ${{github.event.repository.full_name}} tags: latest ${{ github.sha }} oci: true diff --git a/Containerfile b/Containerfile deleted file mode 100644 index 5857dd2d..00000000 --- a/Containerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM nginx:1.27.2-alpine - -RUN rm -r /usr/share/nginx/html \ - && mkdir /usr/share/nginx/html - -WORKDIR /usr/share/nginx/html - -ADD dist . - -CMD nginx -g "daemon off;" \ No newline at end of file diff --git a/infra/.dockerignore b/infra/.dockerignore new file mode 100644 index 00000000..b971de42 --- /dev/null +++ b/infra/.dockerignore @@ -0,0 +1,2 @@ +../dist/build.tar +../dist/output diff --git a/infra/Containerfile b/infra/Containerfile new file mode 100644 index 00000000..16c29639 --- /dev/null +++ b/infra/Containerfile @@ -0,0 +1,15 @@ +FROM nginx:1.27-alpine + +RUN rm -r /usr/share/nginx/html \ + && mkdir -p /usr/share/nginx/html \ + && mkdir -p /etc/nginx/conf.d + +WORKDIR /usr/share/nginx/html + +ADD dist . + +COPY ./infra/default.conf /etc/nginx/conf.d/default.conf + +EXPOSE 8080 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/infra/default.conf b/infra/default.conf new file mode 100644 index 00000000..7a5f1103 --- /dev/null +++ b/infra/default.conf @@ -0,0 +1,42 @@ +server { + listen 8080; + server_name localhost; + + root /usr/share/nginx/html; + index index.html index.htm; + + location / { + try_files $uri $uri/ =404; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + internal; + } + + location ~ /\.ht { + deny all; + } + + gzip on; + gzip_disable "msie6"; + + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types + text/plain + text/css + text/xml + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/xml+rss + font/ttf + font/otf + image/svg+xml; +}