-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
138 lines (119 loc) · 3.71 KB
/
Dockerfile
File metadata and controls
138 lines (119 loc) · 3.71 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
FROM alpine:3.19 AS builder
# =====================
# Dependencies
# =====================
RUN apk add --no-cache \
build-base \
linux-headers \
git \
autoconf \
automake \
libtool \
make \
gd-dev \
geoip-dev \
libxslt-dev \
pcre \
pcre-dev \
perl \
perl-dev \
perl-app-cpanminus \
openssl-dev \
zlib-dev \
libaio-dev \
curl
WORKDIR /usr/src
# =====================
# LuaJIT 2
# =====================
#RUN git clone https://github.com/openresty/luajit2.git
#WORKDIR /usr/src/luajit2
#RUN make -j$(nproc) \
# && make install
#ENV LUAJIT_LIB=/usr/local/lib
#ENV LUAJIT_INC=/usr/local/include/luajit-2.1
# =====================
# lua-resty-lrucache
# =====================
#WORKDIR /usr/src
#RUN git clone https://github.com/openresty/lua-resty-lrucache.git
#WORKDIR /usr/src/lua-resty-lrucache
#RUN make install
# =====================
# lua-resty-core
# =====================
#WORKDIR /usr/src
#RUN git clone -b v0.1.27 https://github.com/openresty/lua-resty-core.git
#WORKDIR /usr/src/lua-resty-core
#RUN make install
# =====================
# Tengine
# =====================
WORKDIR /usr/src
RUN git clone https://github.com/alibaba/tengine.git
WORKDIR /usr/src/tengine
ENV CC=gcc
ENV CXX=g++
RUN ./configure \
#--with-debug \
--with-ipv6 \
--with-openssl-async \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_addition_module \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_geoip_module \
--with-stream_ssl_preread_module \
--with-stream_sni \
#--add-module=./modules/ngx_backtrace_module \
#--add-module=./modules/ngx_debug_pool \
#--add-module=./modules/ngx_debug_timer \
#--add-module=./modules/ngx_debug_conn \
--add-module=./modules/ngx_http_concat_module \
--add-module=./modules/ngx_http_footer_filter_module \
#--add-module=./modules/ngx_http_lua_module \
--add-module=./modules/ngx_http_proxy_connect_module \
--add-module=./modules/ngx_http_reqstat_module \
--add-module=./modules/ngx_http_slice_module \
--add-module=./modules/ngx_http_sysguard_module \
--add-module=./modules/ngx_http_trim_filter_module \
--add-module=./modules/ngx_http_upstream_check_module \
--add-module=./modules/ngx_http_upstream_consistent_hash_module \
--add-module=./modules/ngx_http_upstream_dynamic_module \
--add-module=./modules/ngx_http_upstream_dyups_module \
--add-module=./modules/ngx_http_upstream_iwrr_module \
--add-module=./modules/ngx_http_upstream_keepalive_module \
--add-module=./modules/ngx_http_upstream_session_sticky_module \
--add-module=./modules/ngx_http_upstream_vnswrr_module \
--add-module=./modules/ngx_http_user_agent_module \
--add-module=./modules/ngx_multi_upstream_module \
--add-module=./modules/ngx_slab_stat \
--without-http_upstream_keepalive_module \
--with-ld-opt="-Wl,-rpath,/usr/local/lib -ldl"
RUN make -j$(nproc) \
&& make install
# ----------------------
# Create tengine user/group
# ----------------------
RUN addgroup -S tengine && adduser -S -G tengine tengine
# ----------------------
# Logs
# ----------------------
RUN ln -sf /dev/stdout /usr/local/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/nginx/logs/error.log
# ----------------------
# Entrypoint (optional, can be simpler)
# ----------------------
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# ----------------------
# Ports
# ----------------------
EXPOSE 80 443
# ----------------------
# Default command
# ----------------------
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]