diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index 28c700f..ebec9f9 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -16,7 +16,6 @@ on: - created env: - REGISTRY: ghcr.io USER: alwatr jobs: @@ -36,6 +35,7 @@ jobs: - path: nginx-cdn - path: nginx-pwa - path: nginx-ws + - path: nginx-json permissions: contents: read @@ -68,14 +68,21 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: alwatr-${{ matrix.path }} + key: container/${{ matrix.path }} - - name: 🏗 Log into registry ${{env.REGISTRY}} + - name: 🏗 Log into docker hub registry if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder != 'false' }} uses: docker/login-action@v3.0.0 with: - registry: ${{env.REGISTRY}} - username: ${{github.repository_owner}} + username: ${{env.USER}} + password: ${{secrets.DOCKER_HUB_TOKEN}} + + - name: 🏗 Log into ghcr.io registry + if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder != 'false' }} + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{env.USER}} password: ${{secrets.GITHUB_TOKEN}} - name: 🏗 Extract metadata @@ -84,7 +91,9 @@ jobs: uses: docker/metadata-action@v5.0.0 with: github-token: ${{secrets.GITHUB_TOKEN}} - images: name=${{env.REGISTRY}}/${{env.USER}}/${{matrix.path}},enable=true + images: | + name=ghcr.io/${{env.USER}}/${{matrix.path}},enable=true + name=docker.io/${{env.USER}}/${{matrix.path}},enable=true tags: | type=semver,enable=true,pattern={{major}} type=semver,enable=true,pattern={{major}}.{{minor}} @@ -105,8 +114,8 @@ jobs: BUILD_DATE=${{github.event.repository.updated_at}} BUILD_REV=${{github.sha}} - - name: 🏗 Sign the image with GitHub OIDC Token - if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder != 'false' }} - env: - COSIGN_EXPERIMENTAL: 'true' - run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build_and_push.outputs.digest}} + # - name: 🏗 Sign the image with GitHub OIDC Token + # if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder != 'false' }} + # env: + # COSIGN_EXPERIMENTAL: 'true' + # run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build_and_push.outputs.digest}} diff --git a/README.md b/README.md index d89ab11..4989518 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ # Alwatr Accelerated Web Server -High-performance, accelerated NGINX, optimized for serving static content. Enhanced and accelerated by Alwatr. +This is a high-performance version of NGINX, which has been enhanced by Alwatr for the purpose of serving static content efficiently. ## Usage -The right way of using the alwatr nginx is behind kubernetes ingress or simple edge reverse-proxy, then don't config edge stuff like gzip compression, ssl, etc or even config domain or multiple websites. +The recommended method for using the Alwatr Nginx is to place it behind a Kubernetes ingress or a simple edge reverse-proxy like Traefik. In this setup, there's no need to configure edge features such as gzip compression, SSL, etc., or even set up a domain or multiple websites. ```Dockerfile FROM ghcr.io/alwatr/nginx:1 ``` -### Serve Progressive Web App - -The right way of using the alwatr nginx is behind kubernetes ingress or simple edge reverse-proxy, then don't config edge stuff like gzip compression, ssl, etc or even config domain or multiple websites. +### Serve Progressive Web Apps ```Dockerfile ARG NODE_VERSION=lts diff --git a/nginx-cdn/.dockerignore b/nginx-cdn/.dockerignore index 41d1e72..8a1ad10 100644 --- a/nginx-cdn/.dockerignore +++ b/nginx-cdn/.dockerignore @@ -1,3 +1,4 @@ * !etc/nginx/ -!var/www/ +!data/ + diff --git a/nginx-cdn/Dockerfile b/nginx-cdn/Dockerfile index 5fc5086..748f369 100644 --- a/nginx-cdn/Dockerfile +++ b/nginx-cdn/Dockerfile @@ -1,4 +1,8 @@ -FROM ghcr.io/alwatr/nginx-core:1.1.1 +FROM ghcr.io/alwatr/nginx-core:2.0.0 + +# COPY etc/nginx/ /etc/nginx/ +# COPY data/ . +# RUN ls -RlahF /etc/nginx /data # Default environment for nginx template ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ @@ -20,10 +24,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ ARG BUILD_REV ARG BUILD_DATE LABEL org.opencontainers.image.title="alwatr/nginx-cdn" \ - org.opencontainers.image.description="High-performance, accelerated NGINX, optimized for CDN. Enhanced and accelerated by Alwatr." \ - org.opencontainers.image.base.name="ghcr.io/alwatr/nginx-core:1.1.1" \ - org.opencontainers.image.version="1.1.1" \ - org.opencontainers.image.ref.name="1.1.1-n1.25.3-a3.18-slim" \ + org.opencontainers.image.description="This is a high-performance version of NGINX, which has been enhanced by Alwatr for the purpose of serving static content efficiently." \ + org.opencontainers.image.base.name="ghcr.io/alwatr/nginx-core:2.0.0" \ + org.opencontainers.image.version="2.0.0" \ + org.opencontainers.image.ref.name="2.0.0-nginx1.25.3-alpine3.18-slim" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.created=${BUILD_DATE} \ org.opencontainers.image.revision=${BUILD_REV} \ diff --git a/nginx-core/.dockerignore b/nginx-core/.dockerignore index 41d1e72..eb786ee 100644 --- a/nginx-core/.dockerignore +++ b/nginx-core/.dockerignore @@ -1,3 +1,3 @@ * !etc/nginx/ -!var/www/ +!data/ diff --git a/nginx-core/Dockerfile b/nginx-core/Dockerfile index b35478f..69c225a 100644 --- a/nginx-core/Dockerfile +++ b/nginx-core/Dockerfile @@ -1,11 +1,13 @@ -FROM ghcr.io/alwatr/nginx:1.1.1 +FROM ghcr.io/alwatr/nginx:2.0.0 RUN apk add --no-cache curl HEALTHCHECK --interval=30s --timeout=3s --start-period=1s --retries=3 CMD curl -fso /dev/null http://localhost/server-info || exit 1 +WORKDIR /data + COPY etc/nginx/ /etc/nginx/ -COPY var/www/ /var/www/ -RUN ls -RlAhF /etc/nginx/ +COPY data/ . +RUN ls -RlahF /etc/nginx /data # Default environment for nginx template ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log json" \ @@ -14,7 +16,7 @@ ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log json" \ NGINX_LIMIT_REQ_ERROR=503 \ NGINX_LIMIT_REQ_LOG=notice \ NGINX_AUTOINDEX=off \ - NGINX_DOCUMENT_ROOT=/var/www/html \ + NGINX_DOCUMENT_ROOT=/data \ NGINX_FORCE_DOMAIN="" \ NGINX_FORCE_DOMAIN_STATUS=302 \ NGINX_FORCE_REDIRECT_STATUS=302 \ @@ -40,10 +42,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=10m \ ARG BUILD_REV ARG BUILD_DATE LABEL org.opencontainers.image.title="alwatr/nginx-core" \ - org.opencontainers.image.description="High-performance, accelerated NGINX, optimized for serving static content. Enhanced and accelerated by Alwatr." \ - org.opencontainers.image.base.name="ghcr.io/alwatr/nginx:1.1.1" \ - org.opencontainers.image.version="1.1.1-n1.25.3" \ - org.opencontainers.image.ref.name="1.1.1-n1.25.3-a3.18-slim" \ + org.opencontainers.image.description="HThis is a high-performance version of NGINX, which has been enhanced by Alwatr for the purpose of serving static content efficiently." \ + org.opencontainers.image.base.name="ghcr.io/alwatr/nginx:2.0.0" \ + org.opencontainers.image.version="2.0.0-nginx1.25.3" \ + org.opencontainers.image.ref.name="2.0.0-nginx1.25.3-alpine3.18-slim" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.created=${BUILD_DATE} \ org.opencontainers.image.revision=${BUILD_REV} \ diff --git a/nginx-core/var/www/_error.html b/nginx-core/data/_error.html similarity index 96% rename from nginx-core/var/www/_error.html rename to nginx-core/data/_error.html index 367f4f0..d5779da 100644 --- a/nginx-core/var/www/_error.html +++ b/nginx-core/data/_error.html @@ -4,7 +4,7 @@ - + Error!