forked from wilsonhipolito/nginx-throttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 1.03 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
FROM alpine:3.17
# Add all useful utilitaries for maintenance
RUN apk --update add bash vim curl gettext wget
# Create directory to have our custom scripts and template
RUN mkdir -p /app
WORKDIR /app
# Add required modules, compiling tengine from source
RUN wget https://tengine.taobao.org/download/tengine-3.0.0.tar.gz
RUN tar -xf /app/tengine-3.0.0.tar.gz -C /app
WORKDIR /app/tengine-3.0.0
RUN apk update
RUN apk upgrade
RUN apk add --update --no-cache build-base gcc musl-dev pcre pcre-dev libc6-compat libressl-dev zlib-dev
RUN ./configure \
--add-module=./modules/ngx_http_proxy_connect_module
RUN make
RUN make install
WORKDIR /app
# Copy our custom templates, overwritten when the container start using environment variables
COPY nginx.conf.template /app/nginx.conf.template
COPY sysctl.conf.template /app/sysctl.conf.template
COPY 10-throttle.conf.template /app/10-throttle.conf.template
# Copy the custom script to run when the container start
COPY docker_entrypoint.sh /app/docker_entrypoint.sh
ENTRYPOINT ["/app/docker_entrypoint.sh"]