php.dockerfile 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Set this argument during build time to indicate that the path is for php's www.conf
  2. ARG WWW_CONFIG="/etc/php8/php-fpm.d/www.conf"
  3. # Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site
  4. # These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance
  5. ENV OPEN_SEARCH_TITLE="LibreX"
  6. ENV OPEN_SEARCH_DESCRIPTION="Framework and javascript free privacy respecting meta search engine"
  7. ENV OPEN_SEARCH_ENCODING="UTF-8"
  8. ENV OPEN_SEARCH_LONG_NAME="LibreX search"
  9. ENV OPEN_SEARCH_HOST="http://127.0.0.1:${NGINX_PORT}"
  10. # Replace the 'config.php' script, which contains the most common search engine configurations, with these environment setups
  11. # These environment setups can be found in 'config.php', and the default configurations can be useful for most use cases
  12. ENV CONFIG_GOOGLE_DOMAIN="com"
  13. ENV CONFIG_GOOGLE_LANGUAGE_SITE="en"
  14. ENV CONFIG_GOOGLE_LANGUAGE_RESULTS="en"
  15. ENV CONFIG_INVIDIOUS_INSTANCE="https://invidious.snopyta.org"
  16. ENV CONFIG_HIDDEN_SERVICE_SEARCH=false
  17. ENV CONFIG_DISABLE_BITTORRENT_SEARCH=false
  18. 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"
  19. # Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers
  20. # A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librex
  21. ENV APP_INVIDIOUS=""
  22. ENV APP_RIMGO=""
  23. ENV APP_SCRIBE=""
  24. ENV APP_LIBRARIAN=""
  25. ENV APP_GOTHUB=""
  26. ENV APP_NITTER=""
  27. ENV APP_LIBREREDDIT=""
  28. ENV APP_PROXITOK=""
  29. ENV APP_WIKILESS=""
  30. ENV APP_QUETRE=""
  31. ENV APP_LIBREMDB=""
  32. ENV APP_BREEZEWIKI=""
  33. ENV APP_ANONYMOUS_OVERFLOW=""
  34. ENV APP_SUDS=""
  35. ENV APP_BIBLIOREADS=""
  36. # GNU/Curl configurations. Leave 'CURLOPT_PROXY' blank whether you don't need to use a proxy for requests
  37. # Generally, a proxy is needed when your IP address is blocked by search engines in response to multiple requests within a short time frame. In these cases, it is recommended to use rotating proxies
  38. ENV CURLOPT_PROXY_ENABLED=false
  39. ENV CURLOPT_PROXY=""
  40. ENV CURLOPT_RETURNTRANSFER=true
  41. ENV CURLOPT_ENCODING=""
  42. ENV CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
  43. ENV CURLOPT_CUSTOMREQUEST="GET"
  44. ENV CURLOPT_MAXREDIRS=5
  45. ENV CURLOPT_TIMEOUT=18
  46. ENV CURLOPT_VERBOSE=true
  47. # Install PHP-FPM using Alpine's package manager, apk
  48. # Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient
  49. RUN apk add php8 php8-fpm php8-dom php8-curl php8-json --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\
  50. sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php8\/php-fpm8.sock/' ${WWW_CONFIG} &&\
  51. sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\
  52. sed -i 's/^\s*;\s*listen.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\
  53. sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG}
  54. CMD [ "/bin/sh", "-c", "docker/php/prepare.sh" ]