Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
enhanced Dockerfiles
Michael Peter Christenfa77a20012a5
diff --git a/docker/Dockerfile b/docker/Dockerfileindex c7733fdd6..318b978e6 100644--- a/docker/Dockerfile+++ b/docker/Dockerfile@@ -1,4 +1,4 @@-# Docker image for YaCy+# Ubuntu Docker image for YaCy# build with# docker build -t yacy/yacy_search_server:latest -f Dockerfile ../@@ -9,19 +9,20 @@## builder imageFROM eclipse-temurin:24-jdk-noble AS builder++# Install needed packages not in base imageRUN for i in 1 2 3; do \apt-get update && break || sleep 5; \done && \apt-get install -y --no-install-recommends ant git curl && \rm -rf /var/lib/apt/lists/*-# compile YaCy+# set current working dir & copy sourcesWORKDIR /optCOPY . /opt/yacy_search_server/RUN ant compile -f /opt/yacy_search_server/build.xml# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())-# Intially enable HTTPS: this is the most secure option for remote administrator authenticationRUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/adminAccountForLocalhost=/c\adminAccountForLocalhost=false" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init@@ -41,8 +42,15 @@ RUN adduser --system --group --no-create-home --disabled-password yacyWORKDIR /optCOPY --chown=yacy:yacy --from=builder /opt/yacy_search_server /opt/yacy_search_server+# Expose HTTP and HTTPS default portsEXPOSE 8090 8443++# Set data volume: yacy data and configuration will persist even after container stop or destructionVOLUME ["/opt/yacy_search_server/DATA"]++# Next commands run as yacy as non-root user for improved securityUSER yacy++# Start yacy as a foreground process (-f) to display console logs and to wait for yacy processCMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-f"]diff --git a/docker/Dockerfile.ArchLinux b/docker/Dockerfile.ArchLinuxindex ea7d655d6..ebe8428d0 100644--- a/docker/Dockerfile.ArchLinux+++ b/docker/Dockerfile.ArchLinux@@ -1,3 +1,12 @@+# Arch Linux Docker image for YaCy++# build with+# docker build -t yacy/yacy_search_server:archlinux -f Dockerfile.ArchLinux ../++# run with+# docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:archlinux++FROM archlinux:latest# update the system and clean updiff --git a/docker/Dockerfile.aarch64 b/docker/Dockerfile.aarch64index 765e113cb..a01225ac2 100644--- a/docker/Dockerfile.aarch64+++ b/docker/Dockerfile.aarch64@@ -1,4 +1,4 @@-# Docker image for YaCy+# ARM64v8 Docker image for YaCy# build with# docker build -t yacy/yacy_search_server:aarch64 -f Dockerfile.aarch64 ../@@ -21,7 +21,6 @@ COPY . /opt/yacy_search_server/RUN ant compile -f /opt/yacy_search_server/build.xml# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())-# Intially enable HTTPS: this is the most secure option for remote administrator authenticationRUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/adminAccountForLocalhost=/c\adminAccountForLocalhost=false" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init@@ -41,8 +40,15 @@ RUN adduser --system --group --no-create-home --disabled-password yacyWORKDIR /optCOPY --chown=yacy:yacy --from=builder /opt/yacy_search_server /opt/yacy_search_server+# Expose HTTP and HTTPS default portsEXPOSE 8090 8443++# Set data volume: yacy data and configuration will persist even after container stop or destructionVOLUME ["/opt/yacy_search_server/DATA"]++# Next commands run as yacy as non-root user for improved securityUSER yacy++# Start yacy as a foreground process (-f) to display console logs and to wait for yacy processCMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-f"]diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpineindex 3d1ff1a80..720141774 100644--- a/docker/Dockerfile.alpine+++ b/docker/Dockerfile.alpine@@ -1,5 +1,11 @@-# Build a docker image from latest YaCy sources on Alpine Linux-# with wkhtmltopdf for PDF generation and Java 21+# Alpine Docker image for YaCy++# build with+# docker build -t yacy/yacy_search_server:alpine -f Dockerfile.alpine ../++# run with+# docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:alpine+## builder imageFROM eclipse-temurin:21-jdk-alpine-3.21 AS builder@@ -10,13 +16,9 @@ RUN apk add --no-cache curl git apache-ant# set current working dir & copy sourcesWORKDIR /optCOPY . /opt/yacy_search_server/-RUN ant compile -f /opt/yacy_search_server/build.xml# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())-# Intially enable HTTPS: this is the most secure option for remote administrator authentication-# Create user and group yacy: this user will be used to run YaCy main process-# Set ownership of yacy install directory to yacy user/groupRUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/adminAccountForLocalhost=/c\adminAccountForLocalhost=false" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init@@ -55,6 +57,7 @@ RUN apk add --no-cache \# Copy wkhtmltopdf files from docker-wkhtmltopdf imageCOPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf+# copy YaCy to app imageRUN addgroup yacy && adduser -S -G yacy -H -D yacyWORKDIR /optCOPY --chown=yacy:yacy --from=builder /opt/yacy_search_server /opt/yacy_search_serverdiff --git a/docker/Dockerfile.armv7 b/docker/Dockerfile.armv7index 7a3134eac..285f84d1d 100644--- a/docker/Dockerfile.armv7+++ b/docker/Dockerfile.armv7@@ -1,26 +1,21 @@-# Build a docker image from latest YaCy sources+# arm32v7 Docker image for YaCy++# build with+# docker build -t yacy/yacy_search_server:armv7 -f Dockerfile.armv7 ../++# run with+# docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:armv7+# Base image : latest Debian stable official jdk 11 image from Docker-FROM arm32v7/openjdk:11-jdk+FROM arm32v7/openjdk:11-jdk as builder-# Install needed packages not in base image-# (curl for sh scripts in /bin, and wkhtmltopdf,imagemagick,xvfb and ghostscript to enable PDF and image snapshot generation)+# Install needed packages not in base imageRUN apt-get update && apt-get install -yq curl wkhtmltopdf imagemagick xvfb ghostscript && \rm -rf /var/lib/apt/lists/*-# trace java version-RUN java -version--# set current working dir+# set current working dir & copy sourcesWORKDIR /opt--# All in one step to reduce image size growth :-# - install ant package-# - Compile with ant-# - remove unnecessary and size consuming .git directory-# - remove ant package--# copy sourcesCOPY . /opt/yacy_search_server/RUN rm -rf /opt/yacy_search_server/.git && \@@ -31,16 +26,11 @@ RUN rm -rf /opt/yacy_search_server/.git && \apt-get clean && \rm -rf /var/lib/apt/lists/*-RUN \# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())-# > java -classpath classes net.yacy.cora.order.Digest -strfhex "admin:The YaCy access is limited to administrators. If you don't know the password, you can change it using <yacy-home>/bin/passwd.sh <new-password>:docker"- sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \+RUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \sed -i "/adminAccountForLocalhost=/c\adminAccountForLocalhost=false" /opt/yacy_search_server/defaults/yacy.init && \-# Intially enable HTTPS: this is the most secure option for remote administrator authenticationsed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init && \-# Create user and group yacy: this user will be used to run YaCy main processadduser --system --group --no-create-home --disabled-password yacy && \-# Set ownership of yacy install directory to yacy user/groupchown yacy:yacy -R /opt/yacy_search_server# Expose HTTP and HTTPS default ports