Dockerfile 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. FROM docker:20.10
  2. WORKDIR "/home/librex"
  3. # Docker metadata contains information about the maintainer, such as the name, repository, and support email
  4. # Please add any necessary information or correct any incorrect information
  5. # See more: https://docs.docker.com/config/labels-custom-metadata/
  6. LABEL name="LibreX" \
  7. description="Framework and javascript free privacy respecting meta search engine" \
  8. version="1.0" \
  9. vendor="Hnhx Femboy<femboy.hu>" \
  10. url="https://github.com/hnhx/librex" \
  11. usage="https://github.com/hnhx/librex/wiki" \
  12. authors="https://github.com/hnhx/librex/contributors"
  13. # Include arguments as temporary environment variables to be handled by Docker during the image build process
  14. # Change or add new arguments to customize the image generated by 'docker build' command
  15. ARG DOCKER_SCRIPTS=".docker"
  16. # Customize the environment during both execution and build time by modifying the environment variables added to the container's shell
  17. # When building your image, make sure to set the 'TZ' environment variable to your desired time zone location, for example 'America/Sao_Paulo'
  18. # See more: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
  19. ENV TZ="America/New_York"
  20. # Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site
  21. # These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance
  22. ENV OPEN_SEARCH_TITLE="LibreX"
  23. ENV OPEN_SEARCH_DESCRIPTION="Framework and javascript free privacy respecting meta search engine"
  24. ENV OPEN_SEARCH_ENCODING="UTF-8"
  25. ENV OPEN_SEARCH_LONG_NAME="LibreX Search"
  26. ENV OPEN_SEARCH_HOST="http://localhost:80"
  27. # Replace the 'config.php' script, which contains the most common search engine configurations, with these environment setups
  28. # These environment setups can be found in 'config.php', and the default configurations can be useful for most use cases
  29. ENV CONFIG_GOOGLE_DOMAIN=".com"
  30. ENV CONFIG_GOOGLE_LANGUAGUE="en"
  31. ENV CONFIG_INVIDIOUS_INSTANCE="invidious.namazso.eu"
  32. ENV CONFIG_HIDDEN_SERVICE_SEARCH=false
  33. ENV CONFIG_DISABLE_BITTORRENT_SEARCH=false
  34. 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"
  35. # Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers
  36. # A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librex
  37. ENV APP_INVIDIOUS=""
  38. ENV APP_BIBLIOGRAM=""
  39. ENV APP_RIMGO=""
  40. ENV APP_SCRIBE=""
  41. ENV APP_LIBRARIAN=""
  42. ENV APP_GOTHUB=""
  43. ENV APP_NITTER=""
  44. ENV APP_LIBREREDDIT=""
  45. ENV APP_PROXITOK=""
  46. ENV APP_WIKILESS=""
  47. ENV APP_QUETRE=""
  48. ENV APP_LIBREMDB=""
  49. ENV APP_BREEZEWIKI=""
  50. ENV APP_ANONYMOUS_OVERFLOW=""
  51. # GNU/Curl configurations. Leave 'CURLOPT_PROXY' blank whether you don't need to use a proxy for requests
  52. # 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
  53. ENV CURLOPT_PROXY_ENABLED=false
  54. ENV CURLOPT_PROXY=""
  55. ENV CURLOPT_RETURNTRANSFER=true
  56. ENV CURLOPT_ENCODING=""
  57. 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"
  58. ENV CURLOPT_CUSTOMREQUEST="GET"
  59. ENV CURLOPT_MAXREDIRS=5
  60. ENV CURLOPT_TIMEOUT=18
  61. ENV CURLOPT_VERBOSE=false
  62. # Include docker scripts, docker images, and the 'GNU License' in the Librex container
  63. ADD "${DOCKER_SCRIPTS}/*" "scripts/"
  64. ADD "." "."
  65. # Set permissions for script files as executable scripts inside 'docker/scripts' directory
  66. RUN chmod u+x "scripts/entrypoint.sh" &&\
  67. chmod u+x "scripts/build.sh"
  68. # Add 'zip' package to generate a temporary compressed 'librex.zip' for best recursive copy between Docker images
  69. # Remove unnecessary folders and create a temporary folder that will contain the zip file created earlier
  70. # Compress Librex files, excluding the '.docker' folder containing scripts and the Dockerfile, using the previously downloaded zip package
  71. # Delete all files in the root directory, except for the '.docker' and 'tmp' folders, which are created exclusively to be handled by Docker
  72. RUN apk update; apk add zip --no-cache &&\
  73. rm -rf .git; mkdir -p "tmp/zip" &&\
  74. zip -r "tmp/zip/librex.zip" . -x "scripts/**\*" "Dockerfile\*" &&\
  75. find -maxdepth 1 ! -name "scripts" ! -name "tmp" ! -name "." -exec rm -rv {} \; &&\
  76. apk del -r zip;
  77. # Configures the container to be run as an executable.
  78. ENTRYPOINT ["/bin/sh", "-c", "scripts/entrypoint.sh"]