try the version
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3m45s

This commit is contained in:
pierre geeraert
2026-03-12 23:23:13 +00:00
parent 6840f14913
commit c66d908772
2 changed files with 9 additions and 6 deletions
+7 -6
View File
@@ -1,15 +1,16 @@
ARG NGINX_VERSION
# Stage 1: Build the module
FROM nginx:1.26.3 AS builder
FROM nginx:$NGINX_VERSION AS builder
# Install build tools and MaxMind library
RUN apt-get update && \
apt-get install -y build-essential libmaxminddb-dev libpcre3-dev zlib1g-dev libssl-dev wget git && \
rm -rf /var/lib/apt/lists/*
#https://nginx.org/download/nginx-1.26.3.tar.gz
#https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
# Download NGINX source matching the container version
RUN wget http://nginx.org/download/nginx-1.26.3.tar.gz && \
tar zxf nginx-1.26.3.tar.gz
RUN wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
tar zxf nginx-$NGINX_VERSION.tar.gz
# Clone the specific GeoIP2 module project
RUN git clone https://github.com/leev/ngx_http_geoip2_module.git
@@ -20,13 +21,13 @@ RUN cd nginx-${NGINX_VERSION} && \
make modules
# Stage 2: Final Image
FROM nginx:1.26.3
FROM nginx:$NGINX_VERSION
# Install only the runtime library
RUN apt-get update && apt-get install -y libmaxminddb0 && rm -rf /var/lib/apt/lists/*
# Copy the compiled .so file from the builder
COPY --from=builder /nginx-1.26.3/objs/ngx_http_geoip2_module.so /usr/lib/nginx/modules/
COPY --from=builder /nginx-$NGINX_VERSION/objs/ngx_http_geoip2_module.so /usr/lib/nginx/modules/
# Copy your GeoIP database and NGINX config
# Ensure these files are in the same folder as this Dockerfile