mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-03 16:03:38 +00:00
40
Dockerfile
40
Dockerfile
@@ -29,21 +29,47 @@ RUN apk add --no-cache ca-certificates nodejs-current yarn && \
|
||||
yarn cache clean --all
|
||||
|
||||
FROM python:3.11.3-alpine3.18 as certbot
|
||||
RUN apk add --no-cache build-base libffi-dev && \
|
||||
RUN apk add --no-cache ca-certificates build-base libffi-dev && \
|
||||
python3 -m venv /usr/local/certbot && \
|
||||
. /usr/local/certbot/bin/activate && \
|
||||
pip install --no-cache-dir certbot
|
||||
|
||||
FROM zoeyvid/nginx-quic:122
|
||||
FROM --platform="$BUILDPLATFORM" alpine:3.18.0 as crowdsec
|
||||
RUN apk add --no-cache ca-certificates git build-base && \
|
||||
git clone --recursive https://github.com/crowdsecurity/cs-nginx-bouncer /src && \
|
||||
cd /src && \
|
||||
make && \
|
||||
tar xzf crowdsec-nginx-bouncer.tgz && \
|
||||
mv crowdsec-nginx-bouncer-* crowdsec-nginx-bouncer && \
|
||||
cd /src/crowdsec-nginx-bouncer && \
|
||||
sed -i "/lua_package_path/d" nginx/crowdsec_nginx.conf && \
|
||||
sed -i "s|/etc/crowdsec/bouncers/crowdsec-nginx-bouncer.conf|/data/etc/crowdsec/crowdsec.conf|g" nginx/crowdsec_nginx.conf && \
|
||||
sed -i "s|API_KEY=.*|API_KEY=|g" lua-mod/config_example.conf && \
|
||||
sed -i "s|ENABLED=.*|ENABLED=false|g" lua-mod/config_example.conf && \
|
||||
sed -i "s|API_URL=.*|API_URL=http://127.0.0.1:8080|g" lua-mod/config_example.conf && \
|
||||
sed -i "s|BAN_TEMPLATE_PATH=.*|BAN_TEMPLATE_PATH=/data/etc/crowdsec/ban.html|g" lua-mod/config_example.conf && \
|
||||
sed -i "s|CAPTCHA_TEMPLATE_PATH=.*|CAPTCHA_TEMPLATE_PATH=/data/etc/crowdsec/crowdsec.conf|g" lua-mod/config_example.conf
|
||||
|
||||
FROM zoeyvid/nginx-quic:126
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
nodejs-current \
|
||||
luarocks5.1 wget lua5.1-dev build-base \
|
||||
openssl apache2-utils \
|
||||
coreutils grep jq curl shadow sudo
|
||||
coreutils grep jq curl shadow sudo && \
|
||||
luarocks-5.1 install lua-resty-http && \
|
||||
luarocks-5.1 install lua-cjson && \
|
||||
apk del --no-cache luarocks5.1 wget lua5.1-dev build-base
|
||||
|
||||
COPY rootfs /
|
||||
COPY --from=backend /build/backend /app
|
||||
COPY --from=frontend /build/frontend/dist /app/frontend
|
||||
COPY --from=certbot /usr/local/certbot /usr/local/certbot
|
||||
COPY rootfs /
|
||||
COPY --from=backend /build/backend /app
|
||||
COPY --from=frontend /build/frontend/dist /app/frontend
|
||||
COPY --from=certbot /usr/local/certbot /usr/local/certbot
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/lua-mod/lib/plugins /usr/local/nginx/lib/lua/plugins
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/lua-mod/lib/crowdsec.lua /usr/local/nginx/lib/lua/crowdsec.lua
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/lua-mod/templates/ban.html /usr/local/nginx/conf/conf.d/include/ban.html
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/lua-mod/templates/captcha.html /usr/local/nginx/conf/conf.d/include/captcha.html
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf /usr/local/nginx/conf/conf.d/include/crowdsec.conf
|
||||
COPY --from=crowdsec /src/crowdsec-nginx-bouncer/nginx/crowdsec_nginx.conf /usr/local/nginx/conf/conf.d/include/crowdsec_nginx.conf
|
||||
|
||||
RUN ln -s /app/password-reset.js /usr/local/bin/password-reset.js && \
|
||||
ln -s /app/sqlite-vaccum.js /usr/local/bin/sqlite-vaccum.js && \
|
||||
|
Reference in New Issue
Block a user