diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index 0bdb153..40a3df8 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -31,6 +31,7 @@ jobs: include: - path: nginx - path: nginx-core + - path: nginx-cdn - path: nginx-pwa - path: nginx-ws diff --git a/nginx-cdn/.dockerignore b/nginx-cdn/.dockerignore new file mode 100644 index 0000000..41d1e72 --- /dev/null +++ b/nginx-cdn/.dockerignore @@ -0,0 +1,3 @@ +* +!etc/nginx/ +!var/www/ diff --git a/nginx-cdn/Dockerfile b/nginx-cdn/Dockerfile new file mode 100644 index 0000000..db18d8a --- /dev/null +++ b/nginx-cdn/Dockerfile @@ -0,0 +1,34 @@ +FROM ghcr.io/alwatr/nginx-core:1.1.0 + +# Default environment for nginx template +ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ + NGINX_SENDFILE=on \ + NGINX_SENDFILE_MAX_CHUNK=2m \ + NGINX_TCP_NOPUSH=on \ + NGINX_TCP_NODELAY=on \ + NGINX_OPEN_FILE_CACHE="max=1000 inactive=30m" \ + NGINX_OPEN_FILE_CACHE_VALID=1M \ + NGINX_OPEN_FILE_CACHE_MIN_USES=2 \ + NGINX_OUTPUT_BUFFERS="8 16k" \ + NGINX_EXPIRES_DYNAMIC=max \ + NGINX_EXPIRES_STATIC=max \ + NGINX_EXPIRES_DEFAULT=max \ + NGINX_LIMIT_REQ_RATE=200 \ + NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_DISABLE_SYMLINKS=if_not_owner + +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.0" \ + org.opencontainers.image.version="1.1.0" \ + org.opencontainers.image.ref.name="1.1.0-n1.25.3-a3.18-slim" \ + org.opencontainers.image.licenses="MIT" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.revision=${BUILD_REV} \ + org.opencontainers.image.vendor="Alwatr" \ + org.opencontainers.image.source="https://github.com/Alwatr/nginx" \ + org.opencontainers.image.url="https://github.com/Alwatr/nginx" \ + org.opencontainers.image.documentation="https://github.com/Alwatr/nginx" \ + org.opencontainers.image.authors="S. Ali Mihandoost (https://ali.mihandoost.com), S. Amir Mohammad Najafi (https://njfamirm.ir/)" diff --git a/nginx-core/Dockerfile b/nginx-core/Dockerfile index 9fe2c08..4aaf002 100644 --- a/nginx-core/Dockerfile +++ b/nginx-core/Dockerfile @@ -11,29 +11,30 @@ RUN ls -RlAhF /etc/nginx/ ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log json" \ NGINX_ERROR_LOG_LEVEL=notice \ NGINX_WORKER_CONNECTIONS=2048 \ - NGINX_CLIENT_MAX_BODY_SIZE=10m \ + NGINX_LIMIT_REQ_ERROR=503 \ + NGINX_LIMIT_REQ_LOG=notice \ + NGINX_AUTOINDEX=off \ + NGINX_DOCUMENT_ROOT=/var/www/html \ + NGINX_FORCE_DOMAIN="" \ + NGINX_FORCE_DOMAIN_STATUS=302 \ + NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=1 \ + NGINX_ENTRYPOINT_QUIET_LOGS="" + +ENV NGINX_CLIENT_MAX_BODY_SIZE=10m \ NGINX_SENDFILE=on \ NGINX_SENDFILE_MAX_CHUNK=2m \ NGINX_TCP_NOPUSH=on \ NGINX_TCP_NODELAY=on \ NGINX_OPEN_FILE_CACHE="max=1000 inactive=30m" \ - NGINX_OPEN_FILE_CACHE_VALID=1d \ + NGINX_OPEN_FILE_CACHE_VALID=1s \ NGINX_OPEN_FILE_CACHE_MIN_USES=2 \ NGINX_OUTPUT_BUFFERS="8 16k" \ - NGINX_EXPIRES_DYNAMIC=max \ - NGINX_EXPIRES_STATIC=max \ - NGINX_EXPIRES_DEFAULT=max \ + NGINX_EXPIRES_DYNAMIC=epoch \ + NGINX_EXPIRES_STATIC=epoch \ + NGINX_EXPIRES_DEFAULT=epoch \ NGINX_LIMIT_REQ_RATE=200 \ NGINX_LIMIT_REQ_BURST=1000 \ - NGINX_LIMIT_REQ_ERROR=503 \ - NGINX_LIMIT_REQ_LOG=notice \ - NGINX_AUTOINDEX=off \ - NGINX_DOCUMENT_ROOT=/var/www/html \ - NGINX_DISABLE_SYMLINKS=if_not_owner \ - NGINX_FORCE_DOMAIN="" \ - NGINX_FORCE_DOMAIN_STATUS=302 \ - NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=1 \ - NGINX_ENTRYPOINT_QUIET_LOGS="" + NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV ARG BUILD_DATE diff --git a/nginx-pwa/Dockerfile b/nginx-pwa/Dockerfile index cb438d0..416b084 100644 --- a/nginx-pwa/Dockerfile +++ b/nginx-pwa/Dockerfile @@ -4,14 +4,21 @@ COPY etc/nginx/ /etc/nginx/ RUN ls -RlAhF /etc/nginx/ # Default environment for nginx template -ENV NGINX_OPEN_FILE_CACHE="max=1000 inactive=1h" \ +ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ + NGINX_SENDFILE=on \ + NGINX_SENDFILE_MAX_CHUNK=2m \ + NGINX_TCP_NOPUSH=on \ + NGINX_TCP_NODELAY=on \ + NGINX_OPEN_FILE_CACHE="max=1000 inactive=1h" \ NGINX_OPEN_FILE_CACHE_VALID=1M \ NGINX_OPEN_FILE_CACHE_MIN_USES=2 \ - NGINX_OUTPUT_BUFFERS="8 8k" \ + NGINX_OUTPUT_BUFFERS="8 16k" \ NGINX_EXPIRES_DYNAMIC=epoch \ NGINX_EXPIRES_STATIC=max \ NGINX_EXPIRES_DEFAULT=epoch \ - NGINX_LIMIT_REQ_RATE=400 + NGINX_LIMIT_REQ_RATE=400 \ + NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV ARG BUILD_DATE diff --git a/nginx-ws/Dockerfile b/nginx-ws/Dockerfile index 2d1afa2..7444a25 100644 --- a/nginx-ws/Dockerfile +++ b/nginx-ws/Dockerfile @@ -4,14 +4,21 @@ COPY etc/nginx/ /etc/nginx/ RUN ls -RlAhF /etc/nginx/ # Default environment for nginx template -ENV NGINX_OPEN_FILE_CACHE="max=1000 inactive=1h" \ +ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ + NGINX_SENDFILE=on \ + NGINX_SENDFILE_MAX_CHUNK=2m \ + NGINX_TCP_NOPUSH=on \ + NGINX_TCP_NODELAY=on \ + NGINX_OPEN_FILE_CACHE="max=1000 inactive=1h" \ NGINX_OPEN_FILE_CACHE_VALID=1M \ NGINX_OPEN_FILE_CACHE_MIN_USES=2 \ - NGINX_OUTPUT_BUFFERS="8 8k" \ + NGINX_OUTPUT_BUFFERS="8 16k" \ NGINX_EXPIRES_DYNAMIC=epoch \ - NGINX_EXPIRES_DEFAULT=epoch \ NGINX_EXPIRES_STATIC=max \ - NGINX_LIMIT_REQ_RATE=200 + NGINX_EXPIRES_DEFAULT=epoch \ + NGINX_LIMIT_REQ_RATE=400 \ + NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV ARG BUILD_DATE