⚠️ BREAKING ⚠️: renamed /www to /var!

This commit is contained in:
ElevenNotes
2024-10-11 08:42:54 +02:00
parent a303f0fa7c
commit ca7ef43a84
5 changed files with 17 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ What can I do with this? This image will serve as a base for nginx related image
# VOLUMES
* **/nginx/etc** - Directory of vHost config, must end in *.conf (set in /etc/nginx/nginx.conf)
* **/nginx/www** - Directory of webroot for vHost
* **/nginx/var** - Directory of webroot for vHost
* **/nginx/ssl** - Directory of SSL certificates
# COMPOSE
@@ -20,22 +20,18 @@ services:
image: "11notes/nginx:1.26.2"
container_name: "nginx"
environment:
TZ: Europe/Zurich
TZ: "Europe/Zurich"
ports:
- "8443:8443/tcp"
volumes:
- "etc:/nginx/etc"
- "www:/nginx/www"
- "var:/nginx/var"
- "ssl:/nginx/ssl"
networks:
- nginx
restart: always
restart: "always"
volumes:
etc:
www:
var:
ssl:
networks:
nginx:
```
# DEFAULT SETTINGS

View File

@@ -125,7 +125,7 @@
RUN set -ex; \
mkdir -p ${APP_ROOT}; \
mkdir -p ${APP_ROOT}/etc; \
mkdir -p ${APP_ROOT}/www; \
mkdir -p ${APP_ROOT}/var; \
mkdir -p ${APP_ROOT}/ssl; \
mkdir -p ${APP_ROOT}/cache; \
mkdir -p ${APP_ROOT}/run; \
@@ -148,7 +148,7 @@
/var/log/nginx;
# :: Volumes
VOLUME ["${APP_ROOT}/etc", "${APP_ROOT}/www", "${APP_ROOT}/ssl"]
VOLUME ["${APP_ROOT}/etc", "${APP_ROOT}/var", "${APP_ROOT}/ssl"]
# :: Monitor
HEALTHCHECK --interval=5s --timeout=2s CMD /usr/local/bin/healthcheck.sh || exit 1

View File

@@ -129,7 +129,7 @@
RUN set -ex; \
mkdir -p ${APP_ROOT}; \
mkdir -p ${APP_ROOT}/etc; \
mkdir -p ${APP_ROOT}/www; \
mkdir -p ${APP_ROOT}/var; \
mkdir -p ${APP_ROOT}/ssl; \
mkdir -p ${APP_ROOT}/cache; \
mkdir -p ${APP_ROOT}/run; \
@@ -152,7 +152,7 @@
/var/log/nginx;
# :: Volumes
VOLUME ["${APP_ROOT}/etc", "${APP_ROOT}/www", "${APP_ROOT}/ssl"]
VOLUME ["${APP_ROOT}/etc", "${APP_ROOT}/var", "${APP_ROOT}/ssl"]
# :: Monitor
HEALTHCHECK --interval=5s --timeout=2s CMD /usr/local/bin/healthcheck.sh || exit 1

View File

@@ -3,19 +3,15 @@ services:
image: "11notes/nginx:1.26.2"
container_name: "nginx"
environment:
TZ: Europe/Zurich
TZ: "Europe/Zurich"
ports:
- "8443:8443/tcp"
volumes:
- "etc:/nginx/etc"
- "www:/nginx/www"
- "var:/nginx/var"
- "ssl:/nginx/ssl"
networks:
- nginx
restart: always
restart: "always"
volumes:
etc:
www:
ssl:
networks:
nginx:
var:
ssl:

View File

@@ -1,16 +1,16 @@
#!/bin/ash
if [ ! -f "${APP_ROOT}/ssl/default.crt" ]; then
elevenLogJSON debug "creating default certificate"
openssl req -x509 -newkey rsa:4096 -subj "/C=XX/ST=XX/L=XX/O=XX/OU=XX/CN=${APP_NAME}" \
openssl req -x509 -newkey rsa:4096 -subj "/C=XX/ST=XX/L=XX/O=XX/OU=DOCKER/CN=${APP_NAME}" \
-keyout "${APP_ROOT}/ssl/default.key" \
-out "${APP_ROOT}/ssl/default.crt" \
-days 3650 -nodes -sha256 &> /dev/null
fi
if [ -z "${1}" ]; then
if [ ! -z ${NGINX_DYNAMIC_RELOA} ]; then
if [ ! -z ${NGINX_DYNAMIC_RELOAD} ]; then
elevenLogJSON info "enable dynamic reload"
/sbin/inotifyd /usr/local/bin/io.sh /nginx/etc:cdnym &
/sbin/inotifyd /usr/local/bin/io.sh ${APP_ROOT}/etc:cdnym &
fi
elevenLogJSON info "starting ${APP_NAME} (${APP_VERSION})"