Dockerfile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. ENV PATH="/docker/bin:$PATH"
  21. ENV OPENSEARCH_HOST="http://localhost:80"
  22. # Include docker scripts, docker images, and the 'GNU License' in the Librex container
  23. ADD "${DOCKER_SCRIPTS}/*" "/docker/scripts/"
  24. ADD "." "/docker/"
  25. # Set permissions for script files as executable scripts inside 'docker/scripts' directory
  26. RUN chmod u+x "/docker/scripts/entrypoint.sh" &&\
  27. chmod u+x "/docker/scripts/build.sh"
  28. # Add 'zip' package to generate a temporary compressed 'librex.zip' for best recursive copy between Docker images
  29. # Remove unnecessary folders and create a temporary folder that will contain the zip file created earlier
  30. # Compress Librex files, excluding the '.docker' folder containing scripts and the Dockerfile, using the previously downloaded zip package
  31. # Delete all files in the root directory, except for the '.docker' and 'tmp' folders, which are created exclusively to be handled by Docker
  32. RUN apk update; apk add zip --no-cache &&\
  33. rm -rf .git; mkdir -p "tmp/zip" &&\
  34. zip -r "tmp/zip/librex.zip" . -x "./scripts/**\*" "./Dockerfile\*" &&\
  35. find -maxdepth 1 ! -name "scripts/" ! -name "tmp/" ! -name "./" -exec rm -rv {} \; &&\
  36. apk del -r zip; apk cache clean;
  37. # Configures the container to be run as an executable.
  38. ENTRYPOINT ["/bin/sh", "-c", "/docker/scripts/entrypoint.sh"]