Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module ngx_http_websockify_module #5

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
path = modules/ngx-fancyindex
url = https://github.com/aperezdc/ngx-fancyindex.git
[submodule "modules/njs-acme"]
path = modules/njs-acme
path = njs-modules/njs-acme
url = https://github.com/nginx/njs-acme.git
[submodule "modules/iconv-nginx-module"]
path = modules/iconv-nginx-module
Expand All @@ -49,3 +49,6 @@
[submodule "modules/nginx-otel"]
path = modules/nginx-otel
url = https://github.com/nginxinc/nginx-otel.git
[submodule "modules/websockify-nginx-module"]
path = modules/websockify-nginx-module
url = https://github.com/tg123/websockify-nginx-module.git
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NGINX_VERSION=1.25.2
ARG NGINX_VERSION

# ==================================================================================================== #
FROM nginx:${NGINX_VERSION} AS builder
Expand Down Expand Up @@ -84,6 +84,7 @@ RUN set -ex \
--add-dynamic-module=/usr/src/modules/ModSecurity-nginx \
--add-dynamic-module=/usr/src/modules/naxsi/naxsi_src \
--add-dynamic-module=/usr/src/modules/nginx-otel \
--add-dynamic-module=/usr/src/modules/websockify-nginx-module \
| bash -x \
# build modules
&& make modules -j$(nproc) \
Expand Down Expand Up @@ -111,12 +112,13 @@ RUN set -ex \
https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-Country.mmdb

# ==================================================================================================== #
FROM node AS njs-acme-builder
FROM node AS njs-builder

WORKDIR /app
COPY ./modules/njs-acme .
COPY ./njs-modules .

RUN set -ex \
&& cd njs-acme \
&& npm install \
&& npm run build

Expand All @@ -132,7 +134,7 @@ COPY --from=builder /opt/sregex/lib /opt/sregex/lib
COPY --from=builder /usr/bin/njs /usr/bin/njs
COPY --from=builder usr/src/modules/naxsi/naxsi_rules /etc/nginx/naxsi
COPY --from=builder /usr/share/GeoIP /usr/share/GeoIP
COPY --from=njs-acme-builder /app/dist/acme.js /usr/lib/nginx/njs_modules/acme.js
COPY --from=njs-builder /app/njs-acme/dist/acme.js /usr/lib/nginx/njs_modules/acme.js

# install runtime dependencies
RUN set -ex \
Expand All @@ -149,4 +151,5 @@ RUN set -ex \
libprotobuf32 \
libmodsecurity3 \
modsecurity-crs \
&& ln -s /usr/lib/nginx/modules /etc/nginx/modules \
&& rm -rf /var/lib/apt/lists/*
1 change: 1 addition & 0 deletions modules/websockify-nginx-module