/ Dockerfile
Dockerfile
 1  FROM ubuntu:24.04 as build_release
 2  
 3  # Please note: Docker is supported as an installation method starting with ArchivesSpace v4.0.0, see: https://docs.archivesspace.org/administration/docker/
 4  
 5  ENV DEBIAN_FRONTEND=noninteractive \
 6    JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" \
 7    TZ=UTC
 8  
 9  RUN apt-get update && \
10    apt-get -y install --no-install-recommends \
11    build-essential \
12    git \
13    nodejs \
14    openjdk-21-jre-headless \
15    shared-mime-info \
16    wget \
17    unzip
18  
19  COPY . /source
20  
21  RUN cd /source && \
22    if [ `git describe --tags --exact-match --match v* 2>/dev/null` ]; then \
23    ARCHIVESSPACE_VERSION="$(git describe --tags --match v*)" ; \
24    else \
25    ARCHIVESSPACE_VERSION="$(git symbolic-ref -q --short HEAD)-$(git rev-parse --short HEAD)"; \
26    fi &&\
27    ARCHIVESSPACE_VERSION=${ARCHIVESSPACE_VERSION#"heads/"} && \
28    echo "Using version: $ARCHIVESSPACE_VERSION" && \
29    ./build/run bootstrap && \
30    ./scripts/build_release $ARCHIVESSPACE_VERSION && \
31    mv ./*.zip / && \
32    cd / && \
33    unzip /*.zip -d / && \
34    wget https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/9.1.0/mysql-connector-j-9.1.0.jar && \
35    cp /mysql-connector-j-9.1.0.jar /archivesspace/lib/
36  
37  ADD docker-startup.sh /archivesspace/startup.sh
38  RUN chmod u+x /archivesspace/startup.sh
39  
40  FROM ubuntu:24.04
41  
42  LABEL maintainer="ArchivesSpaceHome@lyrasis.org"
43  
44  ENV ARCHIVESSPACE_LOGS=/dev/null \
45    ASPACE_GC_OPTS="-XX:+UseG1GC -XX:NewRatio=1" \
46    DEBIAN_FRONTEND=noninteractive \
47    JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" \
48    LANG=C.UTF-8 \
49    LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 \
50    TZ=UTC
51  
52  COPY --from=build_release /archivesspace /archivesspace
53  
54  RUN apt-get update && \
55    apt-get -y install --no-install-recommends \
56    ca-certificates \
57    fontconfig \
58    fonts-dejavu-core \
59    fonts-dejavu \
60    fonts-liberation \
61    git \
62    libharfbuzz0b \
63    libjemalloc2 \
64    openjdk-17-jre-headless \
65    netbase \
66    shared-mime-info \
67    wget \
68    nodejs \
69    unzip && \
70    rm -rf /var/lib/apt/lists/* && \
71    chown -R 1000:1000 /archivesspace
72  
73  USER 1000:1000
74  
75  EXPOSE 8080 8081 8089 8090 8092
76  
77  HEALTHCHECK --interval=1m --timeout=5s --start-period=5m --retries=2 \
78    CMD wget -q --spider http://localhost:8089/ || exit 1
79  
80  CMD ["/archivesspace/startup.sh"]