Skip to content
Snippets Groups Projects
Commit 02eeb243 authored by Vineet Reddy Rajula's avatar Vineet Reddy Rajula
Browse files

Nginx, php should communicate through hostname

parent fc8a0397
Branches
Tags
1 merge request!15Remove dependency on shared process namespace for Nginx, php communication
Pipeline #2798948 passed
...@@ -155,9 +155,6 @@ ADD ./php-fpm/config/php-fpm/ /usr/local/etc/php-fpm.d/ ...@@ -155,9 +155,6 @@ ADD ./php-fpm/config/php-fpm/ /usr/local/etc/php-fpm.d/
# - opcache # - opcache
ADD ./php-fpm/config/opcache/ /usr/local/etc/php/conf.d/ ADD ./php-fpm/config/opcache/ /usr/local/etc/php/conf.d/
ADD ./php-fpm/run-php-fpm.sh /
RUN chmod +x /run-php-fpm.sh
ENV DRUPAL_SHARED_VOLUME /drupal-data ENV DRUPAL_SHARED_VOLUME /drupal-data
RUN ln -s ${DRUPAL_SHARED_VOLUME}/files ${DRUPAL_APP_DIR}/web/sites/default/files && \ RUN ln -s ${DRUPAL_SHARED_VOLUME}/files ${DRUPAL_APP_DIR}/web/sites/default/files && \
......
upstream php { upstream php {
server unix:/var/run/drupal.sock; server 127.0.0.1:9000;
} }
server { server {
......
pid /var/run/nginx.pid;
error_log /dev/stderr debug; error_log /dev/stderr debug;
include /etc/nginx/custom.conf; include /etc/nginx/custom.conf;
......
[global]
pid = /var/run/php-fpm.pid
[www] [www]
listen = 9000 listen = 127.0.0.1:9000
pm = dynamic pm = dynamic
pm.max_children = 5 pm.max_children = 5
pm.start_servers = 2 pm.start_servers = 2
......
#!/bin/sh
set -xm
echo "---> Running PHP-FPM..."
rm "$PHP_PID_FILE"
php-fpm &
# Setup symlinks for file from PHP process fs
export PHP_PID_FILE=/var/run/php-fpm.pid
# retry 3 times and if not exit with a error message
for i in {1..3}
do
[ -s "$PHP_PID_FILE" ] || sleep "1s"
done
if [ -s "$PHP_PID_FILE" ]
then
php_pid=$(cat $PHP_PID_FILE)
ln -s /proc/"$php_pid"/root/app /var/run/app
else
echo "Failed to read PHP pid file and create a symlink"
exit 0;
fi
tail -f /proc/$(cat $PHP_PID_FILE)/fd/2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment