forked from Sholex-Team/LilSholex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nginx
29 lines (29 loc) · 1.33 KB
/
Nginx
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
FROM ubuntu:impish
ARG NGINX_VERSION=nginx-1.21.5
ARG OPENSSL_VERSION=openssl-3.0.1
# Compiling
RUN apt update && DEBIAN_FRONTEND="noninteractive" apt install -y build-essential \
libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev python3.9 python3-pip wget \
&& apt autoremove -y && apt autoclean
RUN python3.9 -m pip install --no-cache-dir requests
WORKDIR /root
RUN wget https://nginx.org/download/$NGINX_VERSION.tar.gz && \
wget https://www.openssl.org/source/$OPENSSL_VERSION.tar.gz && tar -xf $NGINX_VERSION.tar.gz && \
tar -xf $OPENSSL_VERSION.tar.gz && cd $NGINX_VERSION && \
./configure --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/nginx.conf --with-openssl-opt=enable-ktls \
--without-http_fastcgi_module --without-http_uwsgi_module --with-pcre --with-openssl=../$OPENSSL_VERSION \
--with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module \
--sbin-path=/usr/bin/nginx && make -j 2 && make install && cd .. && rm -r $NGINX_VERSION* && rm -r $OPENSSL_VERSION*
# Adding Files
RUN mkdir healthchecks
COPY healthchecks/nginx.py nginx.py
COPY conf/nginx.conf /etc/nginx/nginx.conf
# Volumes
VOLUME /var/log/nginx
# Opening Ports
EXPOSE 80/tcp
EXPOSE 443/tcp
# Launch
STOPSIGNAL SIGTERM
CMD nginx -g "daemon off;"