Browse Source

this resolves the issue with a variable that was defined with the value '.com' when it should only be 'com'

Junior L. Botelho (JLB) 2 years ago
parent
commit
8e65f0253a
6 changed files with 17 additions and 18 deletions
  1. 2 2
      Dockerfile
  2. 1 2
      docker/entrypoint.sh
  3. 1 1
      docker/php/config.php
  4. 4 4
      docker/php/php.dockerfile
  5. 9 0
      docker/php/prepare.sh
  6. 0 9
      docker/server/prepare.sh

+ 2 - 2
Dockerfile

@@ -33,11 +33,11 @@ RUN   chmod u+x "${DOCKER_SCRIPTS}/php/prepare.sh" &&\
       chmod u+x "${DOCKER_SCRIPTS}/entrypoint.sh" &&\
       chmod u+x "${DOCKER_SCRIPTS}/attributes.sh"
 
-RUN   apk add openrc abuild-rootbld --no-cache
+RUN   apk add abuild-rootbld --no-cache
 
 # The following lines import all Dockerfiles from other folders so that they can be built together in the final build
-INCLUDE+ docker/server/nginx.dockerfile
 INCLUDE+ docker/php/php.dockerfile
+INCLUDE+ docker/server/nginx.dockerfile
 
 EXPOSE ${NGINX_PORT}
 

+ 1 - 2
docker/entrypoint.sh

@@ -5,7 +5,6 @@
 sh "docker/php/prepare.sh"
 sh "docker/server/prepare.sh"
 
-service php-fpm7 start
-service nginx start
+/bin/sh -c /usr/sbin/php-fpm7
 
 exec nginx -g "daemon off;"

+ 1 - 1
docker/php/config.php

@@ -3,7 +3,7 @@
         "google_domain" => "${CONFIG_GOOGLE_DOMAIN}",
         "google_language" => "${CONFIG_GOOGLE_LANGUAGUE}",
         "invidious_instance_for_video_results" => "${CONFIG_INVIDIOUS_INSTANCE}",
-        
+
         "disable_bittorent_search" => ${CONFIG_DISABLE_BITTORRENT_SEARCH},
         "bittorent_trackers" => "${CONFIG_BITTORRENT_TRACKERS}",
         "disable_hidden_service_search" => ${CONFIG_HIDDEN_SERVICE_SEARCH},

+ 4 - 4
docker/php/php.dockerfile

@@ -6,14 +6,14 @@ ARG WWW_CONFIG="/etc/php7/php-fpm.d/www.conf"
 ENV OPEN_SEARCH_TITLE="LibreX"
 ENV OPEN_SEARCH_DESCRIPTION="Framework and javascript free privacy respecting meta search engine"
 ENV OPEN_SEARCH_ENCODING="UTF-8"
-ENV OPEN_SEARCH_LONG_NAME="LibreX Search"
-ENV OPEN_SEARCH_HOST="http://localhost:${NGINX_PORT}"
+ENV OPEN_SEARCH_LONG_NAME="LibreX search"
+ENV OPEN_SEARCH_HOST="http://127.0.0.1:${NGINX_PORT}"
 
 # Replace the 'config.php' script, which contains the most common search engine configurations, with these environment setups
 # These environment setups can be found in 'config.php', and the default configurations can be useful for most use cases
-ENV CONFIG_GOOGLE_DOMAIN=".com"
+ENV CONFIG_GOOGLE_DOMAIN="com"
 ENV CONFIG_GOOGLE_LANGUAGUE="en"
-ENV CONFIG_INVIDIOUS_INSTANCE="invidious.namazso.eu"
+ENV CONFIG_INVIDIOUS_INSTANCE="https://invidious.namazso.eu"
 ENV CONFIG_HIDDEN_SERVICE_SEARCH=false
 ENV CONFIG_DISABLE_BITTORRENT_SEARCH=false
 ENV CONFIG_BITTORRENT_TRACKERS="&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce"

+ 9 - 0
docker/php/prepare.sh

@@ -5,6 +5,15 @@ echo "[PREPARE] docker/server/prepare.sh'"
 # Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh'
 source "docker/attributes.sh"
 
+# This condition creates the Unix socket if 'php-fpm7.sock' does not already exist.
+# This fixes an issue where Nginx starts but does not serve content
+if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then
+    mkdir "/run/php7"
+    touch "/run/php7/php-fpm7.sock"
+    chmod 0660 "/run/php7/php-fpm7.sock"
+    chown nginx:nginx "/run/php7/php-fpm7.sock"
+fi
+
 # The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used
 # Although not recommended (if you do not know what you are doing), you still have the option to add new substitution file templates using any required environment variables
 [[ ! -s ${CONFIG_PHP_TEMPLATE} ]] && cat 'docker/php/config.php' | envsubst > ${CONFIG_PHP_TEMPLATE};

+ 0 - 9
docker/server/prepare.sh

@@ -5,15 +5,6 @@ echo "[PREPARE] docker/server/prepare.sh'"
 # Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh'
 source "docker/attributes.sh"
 
-# This condition creates the Unix socket if 'php-fpm7.sock' does not already exist.
-# This fixes an issue where Nginx starts but does not serve content
-if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then
-    mkdir "/run/php7"
-    touch "/run/php7/php-fpm7.sock"
-    chmod 0660 "/run/php7/php-fpm7.sock"
-    chown nginx:nginx "/run/php7/php-fpm7.sock"
-fi
-
 export OPEN_SEARCH_HOST_FOR_NGINX="$(echo "${OPEN_SEARCH_HOST}" | cut -d "/" -f 3 | cut -d ":" -f 1)"
 
 # The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used