2023-02-11 18:59:04 -03:00
FROM docker:20.10
2023-02-10 22:29:13 -03:00
WORKDIR "/home/librex"
2023-02-10 19:33:33 -03:00
2023-02-11 18:59:04 -03:00
VOLUME [ "/var/run/docker.sock" ]
2023-02-10 19:33:33 -03:00
# Docker metadata contains information about the maintainer, such as the name, repository, and support email
# Please add any necessary information or correct any incorrect information
# See more: https://docs.docker.com/config/labels-custom-metadata/
LABEL name = "LibreX" \
description = "Framework and javascript free privacy respecting meta search engine" \
version = "1.0" \
vendor = "Hnhx Femboy<femboy.hu>" \
url = "https://github.com/hnhx/librex" \
usage = "https://github.com/hnhx/librex/wiki" \
authors = "https://github.com/hnhx/librex/contributors"
# Include arguments as temporary environment variables to be handled by Docker during the image build process
# Change or add new arguments to customize the image generated by 'docker build' command
ARG DOCKER_SCRIPTS = ".docker"
# Customize the environment during both execution and build time by modifying the environment variables added to the container's shell
# When building your image, make sure to set the 'TZ' environment variable to your desired time zone location, for example 'America/Sao_Paulo'
# See more: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
ENV TZ = "America/New_York"
2023-02-10 23:25:41 -03:00
# Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site
# These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance
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:80"
# 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_LANGUAGUE = "en"
ENV CONFIG_INVIDIOUS_INSTANCE = "invidious.namazso.eu"
ENV CONFIG_HIDDEN_SERVICE_SEARCH = false
ENV CONFIG_DISABLE_BITTORRENT_SEARCH = false
2023-02-11 00:37:09 -03:00
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"
2023-02-10 23:25:41 -03:00
# Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers
# A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librex
ENV APP_INVIDIOUS = ""
ENV APP_BIBLIOGRAM = ""
ENV APP_RIMGO = ""
ENV APP_SCRIBE = ""
ENV APP_LIBRARIAN = ""
ENV APP_GOTHUB = ""
ENV APP_NITTER = ""
ENV APP_LIBREREDDIT = ""
ENV APP_PROXITOK = ""
ENV APP_WIKILESS = ""
ENV APP_QUETRE = ""
ENV APP_LIBREMDB = ""
ENV APP_BREEZEWIKI = ""
ENV APP_ANONYMOUS_OVERFLOW = ""
# GNU/Curl configurations. Leave 'CURLOPT_PROXY' blank whether you don't need to use a proxy for requests
# 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
2023-02-11 00:37:09 -03:00
ENV CURLOPT_PROXY_ENABLED = false
2023-02-10 23:25:41 -03:00
ENV CURLOPT_PROXY = ""
ENV CURLOPT_RETURNTRANSFER = true
ENV CURLOPT_ENCODING = ""
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"
ENV CURLOPT_CUSTOMREQUEST = "GET"
ENV CURLOPT_MAXREDIRS = 5
ENV CURLOPT_TIMEOUT = 18
ENV CURLOPT_VERBOSE = false
2023-02-10 19:33:33 -03:00
# Include docker scripts, docker images, and the 'GNU License' in the Librex container
2023-02-10 23:42:00 -03:00
ADD " ${ DOCKER_SCRIPTS } /* " "scripts/"
ADD "." "."
2023-02-10 22:29:13 -03:00
# Set permissions for script files as executable scripts inside 'docker/scripts' directory
2023-02-10 23:42:00 -03:00
RUN chmod u+x "scripts/entrypoint.sh" && \
2023-02-11 16:53:22 -03:00
chmod u+x "scripts/prepare.sh"
2023-02-10 22:29:13 -03:00
# Add 'zip' package to generate a temporary compressed 'librex.zip' for best recursive copy between Docker images
# Remove unnecessary folders and create a temporary folder that will contain the zip file created earlier
# Compress Librex files, excluding the '.docker' folder containing scripts and the Dockerfile, using the previously downloaded zip package
# Delete all files in the root directory, except for the '.docker' and 'tmp' folders, which are created exclusively to be handled by Docker
2023-02-11 16:53:22 -03:00
RUN apk update; apk add zip abuild-rootbld --no-cache && \
2023-02-11 18:59:04 -03:00
rm -rf .git; mkdir -p "tmp/zip" ; mkdir -p "scripts/tmp" && \
2023-02-10 23:42:00 -03:00
zip -r "tmp/zip/librex.zip" . -x "scripts/**\*" "Dockerfile\*" && \
2023-02-11 15:55:17 -03:00
find -maxdepth 1 ! -name "scripts" ! -name "tmp" ! -name "templates" ! -name "." -exec rm -rv { } \; && \
2023-02-11 16:53:22 -03:00
sh -c 'scripts/prepare.sh' && apk del -r zip abuild-rootbld
2023-02-10 22:29:13 -03:00
# Configures the container to be run as an executable.
2023-02-11 19:14:38 -03:00
ENTRYPOINT [ "/bin/sh" , "-c" , "scripts/entrypoint.sh --images=nginx/php" ]