Merge pull request #2660 from aledbf/fix-modesecurity
Change modsecurity directories
This commit is contained in:
commit
fe9a5aec44
1 changed files with 21 additions and 8 deletions
|
@ -23,19 +23,32 @@ RUN clean-install \
|
||||||
dumb-init \
|
dumb-init \
|
||||||
libcap2-bin
|
libcap2-bin
|
||||||
|
|
||||||
# Create symlinks to redirect nginx logs to stdout and stderr docker log collector
|
|
||||||
# This only works if nginx is started with CMD or ENTRYPOINT
|
|
||||||
RUN mkdir -p /var/log/nginx \
|
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
|
||||||
|
|
||||||
COPY . /
|
COPY . /
|
||||||
|
|
||||||
RUN setcap cap_net_bind_service=+ep /usr/sbin/nginx \
|
RUN setcap cap_net_bind_service=+ep /usr/sbin/nginx \
|
||||||
&& setcap cap_net_bind_service=+ep /nginx-ingress-controller
|
&& setcap cap_net_bind_service=+ep /nginx-ingress-controller
|
||||||
|
|
||||||
RUN mkdir -p /etc/ingress-controller/ssl /etc/ingress-controller/auth \
|
RUN bash -eux -c ' \
|
||||||
&& chown -R www-data.www-data /etc/nginx /etc/ingress-controller
|
writeDirs=( \
|
||||||
|
/etc/nginx \
|
||||||
|
/etc/ingress-controller/ssl \
|
||||||
|
/etc/ingress-controller/auth \
|
||||||
|
/var/log \
|
||||||
|
/var/log/nginx \
|
||||||
|
/opt/modsecurity/var/log \
|
||||||
|
/opt/modsecurity/var/upload \
|
||||||
|
/opt/modsecurity/var/audit \
|
||||||
|
); \
|
||||||
|
for dir in "${writeDirs[@]}"; do \
|
||||||
|
mkdir -p ${dir}; \
|
||||||
|
chown -R www-data.www-data ${dir}; \
|
||||||
|
done \
|
||||||
|
'
|
||||||
|
|
||||||
|
# Create symlinks to redirect nginx logs to stdout and stderr docker log collector
|
||||||
|
# This only works if nginx is started with CMD or ENTRYPOINT
|
||||||
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
|
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
||||||
|
|
||||||
USER www-data
|
USER www-data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue