switching to unix socket for communication between nginx & php-fpm, improves performance and fixes #1

This commit is contained in:
Simon Rupf 2018-06-03 20:33:50 +02:00
parent d2aa0d89eb
commit 14ea837229
3 changed files with 9 additions and 5 deletions

View File

@ -40,14 +40,13 @@ RUN \
&& export GNUPGHOME="$(mktemp -d)" \ && export GNUPGHOME="$(mktemp -d)" \
&& gpg2 --list-public-keys || /bin/true \ && gpg2 --list-public-keys || /bin/true \
&& curl -s https://privatebin.info/key/rugk.asc | gpg2 --import - \ && curl -s https://privatebin.info/key/rugk.asc | gpg2 --import - \
&& rm -rf /var/www/* \
&& cd /tmp \ && cd /tmp \
&& curl -Ls https://github.com/PrivateBin/PrivateBin/releases/download/${RELEASE}/PrivateBin-${RELEASE}.tar.gz.asc > PrivateBin-${RELEASE}.tar.gz.asc \ && curl -Ls https://github.com/PrivateBin/PrivateBin/releases/download/${RELEASE}/PrivateBin-${RELEASE}.tar.gz.asc > PrivateBin-${RELEASE}.tar.gz.asc \
&& curl -Ls https://github.com/PrivateBin/PrivateBin/archive/${RELEASE}.tar.gz > PrivateBin-${RELEASE}.tar.gz \ && curl -Ls https://github.com/PrivateBin/PrivateBin/archive/${RELEASE}.tar.gz > PrivateBin-${RELEASE}.tar.gz \
&& gpg2 --verify PrivateBin-${RELEASE}.tar.gz.asc \ && gpg2 --verify PrivateBin-${RELEASE}.tar.gz.asc \
&& tar -xzf PrivateBin-${RELEASE}.tar.gz \
&& rm -rf /var/www \
&& mv /tmp/PrivateBin-${RELEASE} /var/www \
&& cd /var/www \ && cd /var/www \
&& tar -xzf /tmp/PrivateBin-${RELEASE}.tar.gz --strip 1 \
&& rm *.md cfg/conf.sample.php \ && rm *.md cfg/conf.sample.php \
&& mv cfg /srv \ && mv cfg /srv \
&& mv lib /srv \ && mv lib /srv \
@ -65,7 +64,7 @@ ADD etc/ /etc/
ADD usr/ /usr/ ADD usr/ /usr/
# mark dirs as volumes that need to be writable, allows running the container --read-only # mark dirs as volumes that need to be writable, allows running the container --read-only
VOLUME /srv/data /tmp /var/tmp /var/run /var/log VOLUME /srv/data /tmp /var/tmp /run /var/log
EXPOSE 80 EXPOSE 80

View File

@ -11,7 +11,7 @@ server {
location ~ \.php$ { location ~ \.php$ {
include /etc/nginx/location.d/*.conf; include /etc/nginx/location.d/*.conf;
fastcgi_pass [::]:9000; fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;

View File

@ -0,0 +1,5 @@
[www]
listen = /run/php-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660