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

|
||||
|
||||
# 🏔️ Alpine - Nginx
|
||||
     
|
||||
     
|
||||
|
||||
**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/ssl** - Directory of SSL certificates
|
||||
|
||||
# RUN
|
||||
```shell
|
||||
docker run --name nginx \
|
||||
-v .../etc:/nginx/etc \
|
||||
-v .../www:/nginx/www \
|
||||
-v .../ssl:/nginx/ssl \
|
||||
-d 11notes/nginx:[tag]
|
||||
# COMPOSE
|
||||
```yaml
|
||||
version: "3.8"
|
||||
services:
|
||||
nginx:
|
||||
image: "11notes/nginx:stable"
|
||||
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
|
||||
@@ -44,7 +61,6 @@ docker run --name nginx \
|
||||
* [alpine](https://alpinelinux.org)
|
||||
|
||||
# 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`
|
||||
* Use a reverse proxy like Traefik, Nginx to terminate TLS with a valid certificate
|
||||
* 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
|
||||
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
|
||||
|
||||
RUN set -ex; \
|
||||
@@ -93,6 +102,7 @@
|
||||
|
||||
# :: Header
|
||||
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 /etc/nginx/ /etc/nginx
|
||||
COPY --from=build /usr/lib/nginx/modules/ /etc/nginx/modules
|
||||
|
@@ -1,10 +1,18 @@
|
||||
# :: 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
|
||||
FROM arm64v8/alpine as build
|
||||
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
|
||||
|
||||
RUN set -ex; \
|
||||
@@ -98,6 +106,7 @@
|
||||
# :: Header
|
||||
FROM 11notes/alpine:arm64v8-stable
|
||||
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 /etc/nginx/ /etc/nginx
|
||||
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
|
||||
manifests:
|
||||
- image: 11notes/nginx:amd64-1.24.0
|
||||
- image: 11notes/nginx:1.24.0
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
- image: 11notes/nginx:arm64v8-1.24.0
|
||||
- image: 11notes/nginx:1.24.0
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#!/bin/ash
|
||||
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}" \
|
||||
-keyout "${APP_ROOT}/ssl/default.key" \
|
||||
-out "${APP_ROOT}/ssl/default.crt" \
|
||||
@@ -7,6 +8,7 @@
|
||||
fi
|
||||
|
||||
if [ -z "${1}" ]; then
|
||||
elevenLogJSON info "starting ${APP_NAME}"
|
||||
set -- "nginx" \
|
||||
-g \
|
||||
'daemon off;'
|
||||
|
Reference in New Issue
Block a user