Compare commits
12 Commits
4456653f03
...
5.2-1.21.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 122aa79c21 | |||
| 0389744e37 | |||
| b394e6ac21 | |||
| 0ee6ef3fc4 | |||
| 30388f81cd | |||
| 883529d684 | |||
| 2e26095dbf | |||
| e29ca7690a | |||
| fcd24f0387 | |||
| a4d466fe3f | |||
| e42c94cda9 | |||
| 2f1e21f79b |
@@ -0,0 +1,30 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="build/Dockerfile" type="docker-deploy" factoryName="dockerfile"
|
||||
server-name="Docker on CODE">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="docker.asifbacchus.dev/nginx/ab-nginx:5.2-1.21.3"/>
|
||||
<option name="buildArgs">
|
||||
<list>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="BUILD_DATE"/>
|
||||
<option name="value" value="2021-09-13"/>
|
||||
</DockerEnvVarImpl>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="GIT_COMMIT"/>
|
||||
<option name="value" value="0ee6ef3fc4"/>
|
||||
</DockerEnvVarImpl>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="INTERNAL_VERSION"/>
|
||||
<option name="value" value="5.2"/>
|
||||
</DockerEnvVarImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="buildOnly" value="true"/>
|
||||
<option name="containerName" value=""/>
|
||||
<option name="sourceFilePath" value="build/Dockerfile"/>
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2"/>
|
||||
</configuration>
|
||||
</component>
|
||||
+9
-2
@@ -2,7 +2,7 @@
|
||||
# build AB-NGINX container (based on NGINX mainline)
|
||||
#
|
||||
|
||||
ARG NGINX_VERSION=1.21.1
|
||||
ARG NGINX_VERSION=1.21.3
|
||||
FROM nginx:${NGINX_VERSION}-alpine
|
||||
ARG NGINX_VERSION
|
||||
|
||||
@@ -21,10 +21,14 @@ RUN addgroup --gid ${GID} www-docker \
|
||||
--uid ${UID} \
|
||||
www-docker
|
||||
|
||||
# add libcap, allow nginx to bind to ports <1024, extract fun error pages & create LetsEncrypt challenge directory outside webroot
|
||||
# add libcap and allow nginx to bind to ports <1024;
|
||||
# extract fun error pages;
|
||||
# create /certs directory for auto-generation;
|
||||
# create LetsEncrypt challenge directory outside webroot
|
||||
RUN apk --update --no-cache add \
|
||||
libcap \
|
||||
openssl \
|
||||
&& apk --update --no-cache upgrade \
|
||||
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
|
||||
&& cd /usr/share/nginx \
|
||||
&& rm -rf html/* \
|
||||
@@ -34,6 +38,7 @@ RUN apk --update --no-cache add \
|
||||
&& rm -rf /tmp/* \
|
||||
&& rm -rf /docker-entrypoint.d \
|
||||
&& rm -f /docker-entrypoint.sh \
|
||||
&& mkdir /certs \
|
||||
&& mkdir /usr/share/nginx/letsencrypt
|
||||
|
||||
# health check
|
||||
@@ -76,6 +81,8 @@ RUN chown -R www-docker:www-docker /usr/share/nginx \
|
||||
&& find /etc/nginx -type f -exec chmod 640 {} \; \
|
||||
&& chown www-docker:www-docker /var/cache/nginx \
|
||||
&& chown www-docker:www-docker /var/log/nginx \
|
||||
&& chown www-docker:www-docker /certs \
|
||||
&& chmod 700 /certs \
|
||||
&& chmod 644 /etc/selfsigned.cnf \
|
||||
&& chmod 755 /usr/local/bin/generate-cert /usr/local/bin/entrypoint.sh
|
||||
USER www-docker
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
resolver
|
||||
127.0.0.11;
|
||||
+19
-4
@@ -25,6 +25,15 @@ okNotify() {
|
||||
printf "%s[OK]%s\n" "$ok" "$norm"
|
||||
}
|
||||
|
||||
makeDirectory() {
|
||||
if ! [ -d "./$1" ]; then
|
||||
if ! mkdir "./$1" >/dev/null 2>&1; then
|
||||
errMsgString="Unable to make '$1' directory."
|
||||
errMsg "$errMsgString" 40
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
scriptHelp() {
|
||||
textNewline
|
||||
textBlock "Update ${containerName} container and helper script files"
|
||||
@@ -196,15 +205,17 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
||||
printf "\n%s*** This script has been updated. Please re-run it to load the updated version of this file. ***%s\n\n" "$warn" "$norm"
|
||||
# overwrite this script with updated script
|
||||
mv -f ./update.sh.tmp "$localScriptName"
|
||||
chmod +x "$localScriptName"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
## update files
|
||||
# ensure directories exist
|
||||
if ! mkdir config sites snippets >/dev/null 2>&1; then
|
||||
errMsg "Unable to make directories in which to place updated files." 40
|
||||
fi
|
||||
makeDirectory "config"
|
||||
makeDirectory "sites"
|
||||
makeDirectory "snippets"
|
||||
|
||||
while IFS=' ' read -r field1 field2; do
|
||||
if [ "$field2" = "update.sh" ]; then continue; fi
|
||||
printf "\nChecking '%s' for updates... " "$field2"
|
||||
@@ -243,6 +254,10 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
||||
updateSuccess=$((updateSuccess + 1))
|
||||
# overwrite old version of file
|
||||
mv -f "$updateFilename.tmp" "$updateFilename"
|
||||
if [ "${updateFilename##*.}" = "sh" ]; then
|
||||
# shell file --> make it executable
|
||||
chmod +x "$updateFilename"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user