1.26.0
This commit is contained in:
34
README.md
34
README.md
@@ -1,7 +1,7 @@
|
|||||||

|

|
||||||
|
|
||||||
# 🏔️ Alpine - Nginx
|
# 🏔️ Alpine - Nginx
|
||||||
     
|
     
|
||||||
|
|
||||||
**Nginx base image with additional plugins and custom compiled**
|
**Nginx base image with additional plugins and custom compiled**
|
||||||
|
|
||||||
@@ -13,13 +13,30 @@ What can I do with this? This image will serve as a base for nginx related image
|
|||||||
* **/nginx/www** - Directory of webroot for vHost
|
* **/nginx/www** - Directory of webroot for vHost
|
||||||
* **/nginx/ssl** - Directory of SSL certificates
|
* **/nginx/ssl** - Directory of SSL certificates
|
||||||
|
|
||||||
# RUN
|
# COMPOSE
|
||||||
```shell
|
```yaml
|
||||||
docker run --name nginx \
|
version: "3.8"
|
||||||
-v .../etc:/nginx/etc \
|
services:
|
||||||
-v .../www:/nginx/www \
|
nginx:
|
||||||
-v .../ssl:/nginx/ssl \
|
image: "11notes/nginx:stable"
|
||||||
-d 11notes/nginx:[tag]
|
container_name: "nginx"
|
||||||
|
environment:
|
||||||
|
TZ: Europe/Zurich
|
||||||
|
ports:
|
||||||
|
- "8443:8443/tcp"
|
||||||
|
volumes:
|
||||||
|
- "etc:/nginx/etc"
|
||||||
|
- "www:/nginx/www"
|
||||||
|
- "ssl:/nginx/ssl"
|
||||||
|
networks:
|
||||||
|
- nginx
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
etc:
|
||||||
|
www:
|
||||||
|
ssl:
|
||||||
|
networks:
|
||||||
|
nginx:
|
||||||
```
|
```
|
||||||
|
|
||||||
# DEFAULT SETTINGS
|
# DEFAULT SETTINGS
|
||||||
@@ -44,7 +61,6 @@ docker run --name nginx \
|
|||||||
* [alpine](https://alpinelinux.org)
|
* [alpine](https://alpinelinux.org)
|
||||||
|
|
||||||
# TIPS
|
# TIPS
|
||||||
* Only use rootless container runtime (podman, rootless docker)
|
|
||||||
* Allow non-root ports < 1024 via `echo "net.ipv4.ip_unprivileged_port_start=53" > /etc/sysctl.d/ports.conf`
|
* Allow non-root ports < 1024 via `echo "net.ipv4.ip_unprivileged_port_start=53" > /etc/sysctl.d/ports.conf`
|
||||||
* Use a reverse proxy like Traefik, Nginx to terminate TLS with a valid certificate
|
* Use a reverse proxy like Traefik, Nginx to terminate TLS with a valid certificate
|
||||||
* Use Let’s Encrypt certificates to protect your SSL endpoints
|
* Use Let’s Encrypt certificates to protect your SSL endpoints
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
|
# :: Util
|
||||||
|
FROM alpine as util
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
apk add --no-cache \
|
||||||
|
git; \
|
||||||
|
git clone https://github.com/11notes/util.git;
|
||||||
|
|
||||||
|
|
||||||
# :: Build
|
# :: Build
|
||||||
FROM alpine:latest as build
|
FROM alpine:latest as build
|
||||||
ENV BUILD_VERSION=1.24.0
|
ENV BUILD_VERSION=1.26.0
|
||||||
ENV MODULE_HEADERS_MORE_NGINX_VERSION=0.34
|
ENV MODULE_HEADERS_MORE_NGINX_VERSION=0.34
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
@@ -93,6 +102,7 @@
|
|||||||
|
|
||||||
# :: Header
|
# :: Header
|
||||||
FROM 11notes/alpine:stable
|
FROM 11notes/alpine:stable
|
||||||
|
COPY --from=util /util/linux/shell/elevenLogJSON /usr/local/bin
|
||||||
COPY --from=build /usr/sbin/nginx /usr/sbin
|
COPY --from=build /usr/sbin/nginx /usr/sbin
|
||||||
COPY --from=build /etc/nginx/ /etc/nginx
|
COPY --from=build /etc/nginx/ /etc/nginx
|
||||||
COPY --from=build /usr/lib/nginx/modules/ /etc/nginx/modules
|
COPY --from=build /usr/lib/nginx/modules/ /etc/nginx/modules
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
# :: QEMU
|
# :: QEMU
|
||||||
FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
|
FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
|
||||||
|
|
||||||
|
# :: Util
|
||||||
|
FROM alpine as util
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
apk add --no-cache \
|
||||||
|
git; \
|
||||||
|
git clone https://github.com/11notes/util.git;
|
||||||
|
|
||||||
# :: Build
|
# :: Build
|
||||||
FROM arm64v8/alpine as build
|
FROM arm64v8/alpine as build
|
||||||
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
||||||
ENV BUILD_VERSION=1.24.0
|
ENV BUILD_VERSION=1.26.0
|
||||||
ENV MODULE_HEADERS_MORE_NGINX_VERSION=0.34
|
ENV MODULE_HEADERS_MORE_NGINX_VERSION=0.34
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
@@ -98,6 +106,7 @@
|
|||||||
# :: Header
|
# :: Header
|
||||||
FROM 11notes/alpine:arm64v8-stable
|
FROM 11notes/alpine:arm64v8-stable
|
||||||
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
|
||||||
|
COPY --from=util /util/linux/shell/elevenLogJSON /usr/local/bin
|
||||||
COPY --from=build /usr/sbin/nginx /usr/sbin
|
COPY --from=build /usr/sbin/nginx /usr/sbin
|
||||||
COPY --from=build /etc/nginx/ /etc/nginx
|
COPY --from=build /etc/nginx/ /etc/nginx
|
||||||
COPY --from=build /usr/lib/nginx/modules/ /etc/nginx/modules
|
COPY --from=build /usr/lib/nginx/modules/ /etc/nginx/modules
|
||||||
|
|||||||
22
compose.yaml
Normal file
22
compose.yaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: "11notes/nginx:1.26.0"
|
||||||
|
container_name: "nginx"
|
||||||
|
environment:
|
||||||
|
TZ: Europe/Zurich
|
||||||
|
ports:
|
||||||
|
- "8443:8443/tcp"
|
||||||
|
volumes:
|
||||||
|
- "etc:/nginx/etc"
|
||||||
|
- "www:/nginx/www"
|
||||||
|
- "ssl:/nginx/ssl"
|
||||||
|
networks:
|
||||||
|
- nginx
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
etc:
|
||||||
|
www:
|
||||||
|
ssl:
|
||||||
|
networks:
|
||||||
|
nginx:
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
image: 11notes/nginx:1.24.0
|
image: 11notes/nginx:1.24.0
|
||||||
manifests:
|
manifests:
|
||||||
- image: 11notes/nginx:amd64-1.24.0
|
- image: 11notes/nginx:1.24.0
|
||||||
platform:
|
platform:
|
||||||
architecture: amd64
|
architecture: amd64
|
||||||
os: linux
|
os: linux
|
||||||
- image: 11notes/nginx:arm64v8-1.24.0
|
- image: 11notes/nginx:1.24.0
|
||||||
platform:
|
platform:
|
||||||
architecture: arm64
|
architecture: arm64
|
||||||
os: linux
|
os: linux
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
if [ ! -f "${APP_ROOT}/ssl/default.crt" ]; then
|
if [ ! -f "${APP_ROOT}/ssl/default.crt" ]; then
|
||||||
|
elevenLogJSON info "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=XX/CN=${APP_NAME}" \
|
||||||
-keyout "${APP_ROOT}/ssl/default.key" \
|
-keyout "${APP_ROOT}/ssl/default.key" \
|
||||||
-out "${APP_ROOT}/ssl/default.crt" \
|
-out "${APP_ROOT}/ssl/default.crt" \
|
||||||
@@ -7,6 +8,7 @@
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${1}" ]; then
|
if [ -z "${1}" ]; then
|
||||||
|
elevenLogJSON info "starting ${APP_NAME}"
|
||||||
set -- "nginx" \
|
set -- "nginx" \
|
||||||
-g \
|
-g \
|
||||||
'daemon off;'
|
'daemon off;'
|
||||||
|
|||||||
Reference in New Issue
Block a user