Skip to content

Commit

Permalink
Compile ngx_brotli from source
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed May 28, 2024
1 parent 8208199 commit 6dd48a5
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,38 @@ RUN set -eux; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libnginx-mod-brotli \
netcat-traditional \
; \
rm -rf /var/lib/apt/lists/*

# Compile ngx_brotli
# Set working directory inside the container
WORKDIR /usr/src

# Install dependencies required for building ngx_brotli
RUN apt-get update && \
apt-get install -y git build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev cmake

# Clone the ngx_brotli module from the official GitHub repository
RUN git clone --recurse-submodules https://github.com/google/ngx_brotli.git

# Build the Brotli dependencies
RUN cd ngx_brotli/deps/brotli && \
mkdir out && cd out && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF .. && \
cmake --build . --config Release --target install

# Configure NGINX with ngx_brotli module
RUN cd /usr/src/nginx-1.26.0 && \
./configure --add-module=/usr/src/ngx_brotli && \
make && make install

# Clean up unnecessary files and packages to reduce image size
RUN apt-get remove --purge -y git build-essential libpcre3-dev zlib1g-dev libssl-dev cmake && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/src/ngx_brotli

# MediaWiki setup
RUN set -eux; \
fetchDeps=" \
Expand Down

0 comments on commit 6dd48a5

Please sign in to comment.