Browse Source

update: using unix socket instead of local forward

master
Dnomd343 2 years ago
parent
commit
37260f75ea
  1. 4
      Dockerfile
  2. 1
      init.sh
  3. 7
      nginx/alltube.conf
  4. 2
      nginx/nginx.conf

4
Dockerfile

@ -25,7 +25,9 @@ FROM ${ALPINE}
# TODO: /usr/bin/python already exist after alpine:3.17
RUN apk add --no-cache nginx python3 php-fpm php-mbstring \
php-dom php-gmp php-xml php-intl php-json php-gettext php-simplexml php-tokenizer php-xmlwriter && \
ln -s /usr/bin/python3 /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python && \
sed -i '/error_log/a\error_log = /dev/stdout' /etc/php7/php-fpm.conf && \
sed -i 's?127.0.0.1:9000?/run/php-fpm.sock?' /etc/php7/php-fpm.d/www.conf
COPY --from=build /alltube/ /var/www/alltube/
COPY ./init.sh /usr/bin/alltube
COPY ./nginx/ /etc/nginx/

1
init.sh

@ -3,5 +3,6 @@
if [ -n "$TITLE" ]; then
sed -i "/^appName:/cappName: $TITLE" /var/www/alltube/config/config.yml
fi
/usr/sbin/nginx
exec /usr/sbin/php-fpm7 -F

7
nginx/alltube.conf

@ -1,12 +1,12 @@
server {
listen 80;
root /var/www/alltube/;
index index.php;
root /var/www/alltube/;
types {
text/html html htm shtml;
text/css css;
text/xml xml;
text/html html htm shtml;
application/x-web-app-manifest+json webapp;
}
@ -20,14 +20,13 @@ server {
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/run/php-fpm.sock;
try_files $uri /index.php?$args;
fastcgi_buffers 4 16k;
fastcgi_buffer_size 16k;
fastcgi_index index.php;
fastcgi_intercept_errors off;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param HTTPS 'ok';
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

2
nginx/nginx.conf

@ -10,7 +10,7 @@ events {
http {
log_format access '[$time_iso8601] $remote_addr -> $scheme://$host - "$request"'
' -> ($status) $request_length $bytes_sent {$http_user_agent}';
access_log /dev/stdout access;
access_log /var/log/alltube.log access;
include /etc/nginx/mime.types;
include /etc/nginx/alltube.conf;
}

Loading…
Cancel
Save