From 469ecadbbbbcbe1144c8e45b3283d3f60a1b701f Mon Sep 17 00:00:00 2001 From: Nick Craig Date: Thu, 10 Mar 2022 16:30:49 -0500 Subject: [PATCH] missing updates. --- Jenkinsfile | 12 ++++++------ docker/Dockerfile | 12 +++++++----- docker/rootfs/etc/nginx/conf.d/include/proxy.conf | 4 +--- docker/rootfs/etc/nginx/nginx.conf | 3 +++ 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1b744692..51320be5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { ansiColor('xterm') } environment { - IMAGE = "nginx-proxy-manager" + IMAGE = "owenscorning/aws-nginx-full" BUILD_VERSION = getVersion() MAJOR_VERSION = "2" BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('/', '-')}" @@ -26,7 +26,7 @@ pipeline { } steps { script { - env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:${BUILD_VERSION} -t docker.io/jc21/${IMAGE}:${MAJOR_VERSION} -t docker.io/jc21/${IMAGE}:latest" + env.BUILDX_PUSH_TAGS = "-t docker.io/${IMAGE}:${BUILD_VERSION} -t docker.io/${IMAGE}:${MAJOR_VERSION} -t docker.io/${IMAGE}:latest" } } } @@ -39,7 +39,7 @@ pipeline { steps { script { // Defaults to the Branch name, which is applies to all branches AND pr's - env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}" + env.BUILDX_PUSH_TAGS = "-t docker.io/${IMAGE}:github-${BRANCH_LOWER}" } } } @@ -62,13 +62,13 @@ pipeline { stage('Backend') { steps { echo 'Checking Syntax ...' - sh 'docker pull nginxproxymanager/nginx-full:certbot-node' + sh 'docker pull ${IMAGE}:certbot-node' // See: https://github.com/yarnpkg/yarn/issues/3254 sh '''docker run --rm \\ -v "$(pwd)/backend:/app" \\ -v "$(pwd)/global:/app/global" \\ -w /app \\ - nginxproxymanager/nginx-full:certbot-node \\ + ${IMAGE}:certbot-node \\ sh -c "yarn install && yarn eslint . && rm -rf node_modules" ''' @@ -214,7 +214,7 @@ pipeline { } steps { script { - def comment = pullRequest.comment("This is an automated message from CI:\n\nDocker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.") + def comment = pullRequest.comment("This is an automated message from CI:\n\nDocker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.") } } } diff --git a/docker/Dockerfile b/docker/Dockerfile index 378fffbf..400e94fb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ # This file assumes that the frontend has been built using ./scripts/frontend-build -FROM nginxproxymanager/nginx-full:certbot-node +FROM 413067109875.dkr.ecr.us-east-1.amazonaws.com/owenscorning/aws-nginx-full:certbot-node ARG TARGETPLATFORM ARG BUILD_VERSION @@ -20,6 +20,7 @@ ENV SUPPRESS_NO_CONFIG_WARNING=1 \ RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \ && apt-get update \ + && apt-get upgrade -y \ && apt-get install -y --no-install-recommends jq logrotate \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -56,8 +57,9 @@ ENTRYPOINT [ "/init" ] LABEL org.label-schema.schema-version="1.0" \ org.label-schema.license="MIT" \ - org.label-schema.name="nginx-proxy-manager" \ + org.label-schema.name="aws-nginx-full" \ org.label-schema.description="Docker container for managing Nginx proxy hosts with a simple, powerful interface " \ - org.label-schema.url="https://github.com/jc21/nginx-proxy-manager" \ - org.label-schema.vcs-url="https://github.com/jc21/nginx-proxy-manager.git" \ - org.label-schema.cmd="docker run --rm -ti jc21/nginx-proxy-manager:latest" + org.label-schema.url="https://github.com/owenscorning/docker-aws-nginx-full" \ + org.label-schema.vcs-url="https://github.com/owenscorning/docker-aws-nginx-full.git" \ + org.label-schema.cmd="docker run --rm -ti owenscorning/aws-nginx-full:latest" + diff --git a/docker/rootfs/etc/nginx/conf.d/include/proxy.conf b/docker/rootfs/etc/nginx/conf.d/include/proxy.conf index e6f9ee16..8de93bd3 100644 --- a/docker/rootfs/etc/nginx/conf.d/include/proxy.conf +++ b/docker/rootfs/etc/nginx/conf.d/include/proxy.conf @@ -2,6 +2,4 @@ add_header X-Served-By $host; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; -proxy_set_header X-Real-IP $remote_addr; -proxy_pass $forward_scheme://$server:$port$request_uri; - +proxy_set_header X-Real-IP $remote_addr; \ No newline at end of file diff --git a/docker/rootfs/etc/nginx/nginx.conf b/docker/rootfs/etc/nginx/nginx.conf index 4d5ee901..dd565b6f 100644 --- a/docker/rootfs/etc/nginx/nginx.conf +++ b/docker/rootfs/etc/nginx/nginx.conf @@ -45,8 +45,11 @@ http { log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"'; log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"'; + log_format cloudwatch escape=json '{"time":"$time_iso8601","filename":"$request_filename","remoteIP":"$remote_addr","host":"$host","request":"$request","query":"$query_string","method":"$request_method","status":"$status","userAgent":"$http_user_agent","referer":"$http_referer"}'; + access_log /data/logs/fallback_access.log proxy; + access_log /data/logs/fallback_access.cloudwatch.log cloudwatch; # Dynamically generated resolvers file include /etc/nginx/conf.d/include/resolvers.conf;