-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
57 lines (42 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM alpine
# Define the version as a build argument for easy updates
ARG NGINX_VERSION=1.24.0
ARG OPENSSL_VERSION=3.2.1
RUN apk add --no-cache \
gcc \
libc-dev \
make \
openssl-dev \
pcre-dev \
zlib-dev \
wget \
patch \
perl-dev \
linux-headers
RUN adduser -D dswebuser
WORKDIR /tmp
COPY . ./ja4-nginx-module
# INSTALL NGINX
RUN wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxvf nginx-${NGINX_VERSION}.tar.gz
# INSTALL OpenSSL
RUN wget https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz && \
tar -zxvf openssl-${OPENSSL_VERSION}.tar.gz
# patch openssl
WORKDIR /tmp/openssl-${OPENSSL_VERSION}
RUN patch -p1 < /tmp/ja4-nginx-module/patches/openssl.patch
# patch nginx
WORKDIR /tmp/nginx-${NGINX_VERSION}
RUN patch -p1 < /tmp/ja4-nginx-module/patches/nginx.patch
# Build Nginx
RUN ./configure --with-openssl=/tmp/openssl-${OPENSSL_VERSION} --with-debug --with-compat --add-module=/tmp/ja4-nginx-module/src --with-http_ssl_module --prefix=/etc/nginx && \
make && \
make install
# Cleanup
WORKDIR /
RUN rm -rf /tmp/
# Link Nginx logs to stdout and stderr
RUN ln -sf /dev/stdout /etc/nginx/logs/access.log && \
ln -sf /dev/stderr /etc/nginx/logs/error.log
# CMD directive to run Nginx in the foreground
CMD ["/etc/nginx/sbin/nginx", "-g", "daemon off;"]