File tree 2 files changed +22
-3
lines changed
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ RUN set -x \
18
18
RUN set -x \
19
19
&& apt-get update \
20
20
&& apt-get -y install nginx \
21
- && apt-clean --aggressive
21
+ && apt-clean --aggressive \
22
+ && sed -i "s/\( worker_processes\) .*;$/\1 1;/" /etc/nginx/nginx.conf
23
+
24
+ COPY entrypoint /entrypoint
22
25
23
- ENTRYPOINT ["/tini" , "--" ]
24
- CMD ["nginx" , "-g" , "daemon off;" ]
26
+ ENTRYPOINT ["/tini" , "--" , "/entrypoint" ]
27
+ CMD ["nginx" ]
25
28
EXPOSE 80 443
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ if [ " ${1: 0: 1} " = " -" ]; then
4
+ set -- nginx " $@ "
5
+ fi
6
+
7
+ if [ " $1 " = " nginx" ]; then
8
+ # forward access and error logs to docker log collector
9
+ [ -z " $NOSTDOUTREDIR " ] && ln -sf /dev/stdout /var/log/nginx/access.log
10
+ [ -z " $NOSTDERRREDIR " ] && ln -sf /dev/stderr /var/log/nginx/error.log
11
+
12
+ # run nginx in the foreground
13
+ exec " $@ " -g " daemon off;"
14
+ fi
15
+
16
+ exec " $@ "
You can’t perform that action at this time.
0 commit comments