summaryrefslogtreecommitdiff
path: root/docker/Dockerfile.armv7
blob: c1758be97ea83747c5289ffe2af3100de7608b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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 as builder

# Install needed packages not in base image
RUN apt-get update && apt-get install -yq curl wkhtmltopdf imagemagick xvfb ghostscript && \
  rm -rf /var/lib/apt/lists/*

# set current working dir & copy sources
WORKDIR /opt
COPY . /opt/yacy_search_server/

# .git dir deleted here because .git is needed during the build to deterime the version,
# but isn't required at runtime
RUN ant compile -f /opt/yacy_search_server/build.xml \
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 && \
	apt-get purge -yq --auto-remove ant && \
	apt-get clean && \
  rm -fr /opt/yacy_search_server/.git && \
	rm -rf /var/lib/apt/lists/*

# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
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 && \
	sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init && \
	adduser --system --group --no-create-home --disabled-password yacy && \
	chown yacy:yacy -R /opt/yacy_search_server

# Expose HTTP and HTTPS default ports
EXPOSE 8090 8443

# 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"]