-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (38 loc) · 1.35 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (38 loc) · 1.35 KB
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
FROM nginx:1.25.3 as builder
RUN apt-get update && apt-get install -y \
build-essential \
wget \
libpcre3-dev \
zlib1g-dev
RUN wget http://nginx.org/download/nginx-1.25.3.tar.gz && \
tar -xzf nginx-1.25.3.tar.gz
WORKDIR /nginx-1.25.3
COPY ngx_http_hello_module.c .
COPY config .
RUN ./configure --prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--add-module=. && \
make && \
make install
FROM debian:12
RUN apt-get update && apt-get install -y \
libpcre3 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/local/nginx/client_body_temp \
/usr/local/nginx/proxy_temp \
/usr/local/nginx/fastcgi_temp \
/usr/local/nginx/uwsgi_temp \
/usr/local/nginx/scgi_temp \
/usr/local/nginx/html
COPY --from=builder /usr/sbin/nginx /usr/sbin/nginx
COPY --from=builder /usr/lib/nginx/modules/ /usr/lib/nginx/modules/
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["/usr/sbin/nginx", "-g", "daemon off;"]