diff options
| author | Michael Peter Christen <mc@yacy.net> | 2020-12-29 21:01:35 +0100 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2020-12-29 21:01:35 +0100 |
| commit | 062111a00374ec6be27186a5b0347c7412a47cd9 (patch) | |
| tree | 4e96829f2f50df96ae59b0878365358074cf5c0a /docker/Dockerfile.alpine | |
| parent | 4c920d05b5cd50b1357d40e20633a5f8163bbc27 (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.alpine')
| -rw-r--r-- | docker/Dockerfile.alpine | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index 15ee1993a..e0b8d9600 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -77,40 +77,38 @@ ENV PATH ${PATH}:/opt/ant/bin WORKDIR /opt # All in one step to reduce image size growth : -# - add git package -# - clone main YaCy git repository (we need to clone git repository to generate correct version when building from source) # - compile with apache ant -# - remove unnecessary and size consuming .git directory -# - delete git package and ant binary install +# - delete ant binary install -# 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 apk add --no-cache git && \ - git clone https://github.com/yacy/yacy_search_server.git && \ +RUN apk add --no-cache \ ant compile -f /opt/yacy_search_server/build.xml && \ rm -rf /opt/yacy_search_server/.git && \ - rm -rf /opt/ant && \ - apk del git + rm -rf /opt/ant RUN \ -# Set initial admin password : "docker" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex()) - 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 +# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex()) + 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 addgroup yacy && adduser -S -G yacy -H -D yacy && \ # Set ownership of yacy install directory to yacy user/group chown yacy:yacy -R /opt/yacy_search_server +RUN rm -rf /opt/yacy_search_server/DATA + # Expose HTTP and HTTPS default ports EXPOSE 8090 8443 -# Set data volume : yacy data and configuration will persist aven 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 USER yacy # Start yacy as a foreground process (-f) to display console logs and to wait for yacy process -CMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-f"]
\ No newline at end of file +CMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-f"] |
