summaryrefslogtreecommitdiff
path: root/docker/Dockerfile
diff options
context:
space:
mode:
authorMichael Peter Christen <mc@yacy.net>2020-12-29 21:01:35 +0100
committerMichael Peter Christen <mc@yacy.net>2020-12-29 21:01:35 +0100
commit062111a00374ec6be27186a5b0347c7412a47cd9 (patch)
tree4e96829f2f50df96ae59b0878365358074cf5c0a /docker/Dockerfile
parent4c920d05b5cd50b1357d40e20633a5f8163bbc27 (diff)
improved dockerfiles
They do not use git pull to get the latest YaCy code. Instead they copy from local file system.
Diffstat (limited to 'docker/Dockerfile')
-rw-r--r--docker/Dockerfile29
1 files changed, 14 insertions, 15 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index d8f19c7d5..8e44854d7 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -15,31 +15,30 @@ RUN java -version
WORKDIR /opt
# All in one step to reduce image size growth :
-# - install ant and git packages
-# - clone main YaCy git repository (we need to clone git repository to generate correct version when building from source)
+# - install ant package
# - Compile with ant
# - remove unnecessary and size consuming .git directory
-# - remove ant and git packages
+# - remove ant package
-# Possible alternative : copy directly your current sources an remove git clone command from the following RUN
-# COPY . /opt/yacy_search_server/
+# copy sources
+COPY . /opt/yacy_search_server/
-RUN apt-get update && \
- apt-get install -yq ant git && \
- git clone https://github.com/yacy/yacy_search_server.git && \
+RUN rm -rf /opt/yacy_search_server/.git && \
+ apt-get update && \
+ apt-get install -yq ant && \
ant compile -f /opt/yacy_search_server/build.xml && \
- rm -rf /opt/yacy_search_server/.git && \
- apt-get purge -yq --auto-remove ant git && \
+ apt-get purge -yq --auto-remove ant && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN \
-# Set initial admin password : "docker" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
+# 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:e672161ffdce91be4678605f4f4e6786" /opt/yacy_search_server/defaults/yacy.init && \
-# Intially enable HTTPS : this is the most secure option for remote administrator authentication
+ 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 authentication
sed -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 process
+# Create user and group yacy: this user will be used to run YaCy main process
adduser --system --group --no-create-home --disabled-password yacy && \
# Set ownership of yacy install directory to yacy user/group
chown yacy:yacy -R /opt/yacy_search_server
@@ -47,7 +46,7 @@ RUN \
# Expose HTTP and HTTPS default ports
EXPOSE 8090 8443
-# Set data volume : yacy data and configuration will persist even after container stop or destruction
+# Set data volume: yacy data and configuration will persist even after container stop or destruction
VOLUME ["/opt/yacy_search_server/DATA"]
# Next commands run as yacy as non-root user for improved security