Skip to content

Instantly share code, notes, and snippets.

@18601673727
Created April 6, 2016 19:00
Show Gist options
  • Save 18601673727/0ea43adde6691af201552b42285add7e to your computer and use it in GitHub Desktop.
Save 18601673727/0ea43adde6691af201552b42285add7e to your computer and use it in GitHub Desktop.
path=/opt/docker/etc/nginx/vhost.conf
endpoint="fastcgi_read_timeout"
patch="fastcgi_buffer_size 128k;fastcgi_buffers 32 32k;"
if grep -q "$patch" $path ; then
echo 'already patched, skip!'
else
echo 'no patch found, now patch'
sed -i "/$endpoint/i $patch" $path
fi
@18601673727
Copy link
Author

Dockerfile

FROM client
ADD ./patch_fastcgi_buffer.sh /home/patches
RUN chmod +x /home/patches/patch_fastcgi_buffer.sh && sh /home/patches/patch_fastcgi_buffer.sh
RUN nginx -s reload

@18601673727
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment