Skip to content

Commit ff5d12c

Browse files
DP-2130: Update ASpace to v4.1.1
- Bumps ASpace to the latest version. - Bumps Digitization Work Order plugin to 2.x to support ASpace v4. - Upgrades Solr to v9 (required by ASpace v4). - Reconfigures Solr to use a custom build rather than bind-mounted core configs. - Renames Docker Compose files to preferred "compose.yml". - Adds ability to test DB migrations with existing data loaded to `./db/dumps`.
1 parent d9340e2 commit ff5d12c

14 files changed

Lines changed: 88 additions & 514 deletions

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
.env
2+
.git
3+
.github
4+
.gitignore
5+
db
6+
init

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
APPCONFIG_DB_URL=jdbc:mysql://db:3306/archivesspace?useUnicode=true&characterEncoding=UTF-8&user=archivesspace&password=archivesspace
2+
ARCHIVESSPACE_VERSION="v4.1.1"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
.env
2+
db/dumps/*
3+
!db/dumps/.keep
4+
data
5+
init

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# ============================================================
22
# Adding comment to trigger a build
33
# BASE Stage
4-
FROM ubuntu:20.04 AS base
4+
FROM ubuntu:noble AS base
55

6-
ARG ARCHIVESSPACE_VERSION="v3.3.1"
6+
ARG ARCHIVESSPACE_VERSION="v4.1.1"
77
ARG ARCHIVESSPACE_USER_UID="40052"
88
ARG ARCHIVESSPACE_USER_GID="40052"
9-
ARG DWO_PLUGIN_VERSION="v1.13"
9+
ARG DWO_PLUGIN_VERSION="v2.1"
1010
ARG MT_PLUGIN_VERSION="v1.5"
11-
ARG MYSQL_CONNECTOR_VERSION="8.0.23"
11+
ARG MYSQL_CONNECTOR_VERSION="9.5.0"
1212

1313
ENV ARCHIVESSPACE_LOGS="/dev/null"
1414
ENV ARCHIVESSPACE_PLUGIN_DWO_URL="https://github.com/hudmol/digitization_work_order/archive/refs/tags/${DWO_PLUGIN_VERSION}.zip"
1515
ENV ARCHIVESSPACE_PLUGIN_MT_URL="https://github.com/hudmol/material_types/archive/refs/tags/${MT_PLUGIN_VERSION}.zip"
1616
ENV ARCHIVESSPACE_SOURCE_URL="https://github.com/archivesspace/archivesspace/releases/download/${ARCHIVESSPACE_VERSION}/archivesspace-${ARCHIVESSPACE_VERSION}.zip"
1717
ENV DEBIAN_FRONTEND="noninteractive"
1818
ENV LANG="C.UTF-8"
19-
ENV MYSQL_CONNECTOR_JAR_URL="https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_CONNECTOR_VERSION}/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.jar"
19+
ENV MYSQL_CONNECTOR_JAR_URL="https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/${MYSQL_CONNECTOR_VERSION}/mysql-connector-j-${MYSQL_CONNECTOR_VERSION}.jar"
2020
ENV TZ="UTC"
2121

2222
RUN apt-get update && \
2323
apt-get -y install --no-install-recommends \
2424
ca-certificates \
2525
git \
2626
netbase \
27-
openjdk-11-jre-headless \
27+
openjdk-17-jre-headless \
2828
shared-mime-info \
2929
vim \
3030
wget \
@@ -70,26 +70,24 @@ RUN wget -O material_types.zip "$ARCHIVESSPACE_PLUGIN_MT_URL" && \
7070
FROM base AS final
7171

7272
# Copy the built ArchivesSpace
73-
COPY --from=aspace --chown=root:archivesspace /opt/app /opt/app
73+
COPY --from=aspace --chown=archivesspace:archivesspace /opt/app /opt/app
7474

7575
# Copy in our custom config files
76-
COPY --chown=root:archivesspace files/config/config.rb /opt/app/config/config.rb
77-
COPY --chown=root:archivesspace files/plugins/local/frontend/assets/images/* /opt/app/plugins/local/frontend/assets/images/
78-
COPY --chown=root:archivesspace files/plugins/local/frontend/locales/en.rb /opt/app/plugins/local/frontend/locales/en.rb
76+
COPY --chown=archivesspace:archivesspace files/plugins/local/frontend/assets/images/* /opt/app/plugins/local/frontend/assets/images/
77+
COPY --chown=archivesspace:archivesspace files/plugins/local/frontend/locales/en.rb /opt/app/plugins/local/frontend/locales/en.rb
7978

8079
# Copy the built DWO plugin
81-
COPY --from=digitization_work_order --chown=root:archivesspace \
80+
COPY --from=digitization_work_order --chown=archivesspace:archivesspace \
8281
/opt/app/plugins/digitization_work_order \
8382
/opt/app/plugins/digitization_work_order
8483

8584
# Copy the built Materials Type plugin
86-
COPY --from=material_types --chown=root:archivesspace \
85+
COPY --from=material_types --chown=archivesspace:archivesspace \
8786
/opt/app/plugins/material_types \
8887
/opt/app/plugins/material_types
8988

9089
# Install the entrypoint script.
91-
COPY --chown=root:archivesspace docker-entrypoint.sh /bin/docker-entrypoint.sh
92-
RUN chmod ug+x /bin/docker-entrypoint.sh
90+
COPY --chown=archivesspace:archivesspace files/docker-entrypoint.sh /bin/docker-entrypoint.sh
9391
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
9492

9593
USER archivesspace

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@ This repo Dockerizes ArchivesSpace. In a nutshell:
66
# Populate your local .env file with secrets (e.g. OCLC keys)
77
cp .env.example .env
88

9-
# Build the stack
9+
# Build the stack / pull dependencies
1010
docker compose build
11+
docker compose pull
1112

1213
# Run it all
13-
docker compose up -d
14+
docker compose up --wait
15+
16+
# Open ASpace in your browser
17+
open http://localhost:8080
1418
```
1519

20+
For ArchivesSpace v4+, consult their excellent [new documentation site](https://docs.archivesspace.org/).
21+
1622
### Database Initialization
1723

18-
The database is initialized by an "updater" service which simply runs `scripts/setup-database.sh` and exits. Docker should retry it continuously until it succeeds.
24+
* The database is initialized by an "updater" service which simply runs `scripts/setup-database.sh` and exits. Docker should retry it continuously until it succeeds.
25+
* To test migrations with real data, add a dump to the `db/dumps/` directory. The updater still runs against this, making it helpful for testing whether your data will survive a migration.
1926

2027
### Secrets
2128

22-
We've added an entrypoint.sh shim script which loads files from `/run/secrets` into the environment before running a given command. Secrets can be added there using Docker's normal methods, but read from the application using `ENV`.
29+
We've added a `docker-entrypoint.sh` shim script which loads files from `/run/secrets` into the environment before running a given command. Secrets can be added there using Docker's normal methods, but read from the application using `ENV`.
2330

2431
### Configuration File
2532

compose.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22

33
services:
44
app: &services_app
5-
build: .
6-
user: root
5+
build:
6+
context: .
7+
args: &aspace-build-args
8+
- ARCHIVESSPACE_VERSION=${ARCHIVESSPACE_VERSION:-v4.1.1}
9+
# ASpace bundles a lot of services, for a full reference:
10+
# @see https://docs.archivesspace.org/customization/configuration/#urls-for-archivesspace-components
711
ports:
8-
- 8080:8080
9-
- 8081:8081
10-
- 8082:8082
11-
- 8089:8089
12-
- 8090:8090
12+
- 8080:8080 # staff
13+
- 8081:8081 # public (disabled by APPCONFIG_ENABLE_PUBLIC)
14+
- 8082:8082 # OAI harvesting
15+
- 8888:8888 # documentation
16+
- 8089:8089 # backend
17+
- 8090:8090 # built-in solr (unused)
18+
- 8091:8091 # indexer
1319
configs:
14-
- source: config.rb
15-
target: /opt/app/config/config.rb
1620
- source: en-locales.yml
1721
target: /opt/app/locales/enums/en.yml
1822
depends_on:
@@ -22,9 +26,6 @@ services:
2226
condition: service_healthy
2327
updater:
2428
condition: service_completed_successfully
25-
secrets:
26-
# @note Customize these in your local .env file if necessary
27-
- APPCONFIG_DB_URL
2829
environment:
2930
# @note ArchivesSpace settings can be specified by setting ENV vars of the form
3031
# APPCONFIG_<Upcased Parameter Name>. We have run into problems with any
@@ -34,12 +35,16 @@ services:
3435
- APPCONFIG_FRONTEND_BRANDING_IMG_ALT_TEXT=ArchivesSpace Local Development Logo
3536
- APPCONFIG_PLUGINS_OVERRIDE=local,lcnaf,digitization_work_order,material_types
3637
- APPCONFIG_ENABLE_PUBLIC=false
38+
- APPCONFIG_PUI_INDEXER_ENABLED=false
3739
- APPCONFIG_SOLR_URL=http://solr:8983/solr/archivesspace
3840
- APPCONFIG_SOLR_VERIFY_CHECKSUMS=false
3941
- ASPACE_LOGGED_IN_MSG=You are logged in to a local development instance of ArchivesSpace
4042
- ASPACE_WELCOME_HEADING=ArchivesSpace Development (local)
4143
- ASPACE_WELCOME_MESSAGE=You are on a local development instance of ArchivesSpace
4244
- JAVA_OPTS=-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xss512k -Djavax.accessibility.assistive_technologies=''
45+
# @note Use `secrets:` instead of `environment:` to test that the entrypoint loads them into ENV
46+
secrets:
47+
- APPCONFIG_DB_URL
4348
volumes:
4449
- aspace_data:/opt/app/data
4550
- solr_data:/var/solr/data:ro
@@ -54,17 +59,20 @@ services:
5459
restart: on-failure
5560

5661
solr:
57-
image: solr:8.11.2
62+
build:
63+
context: solr
64+
args: *aspace-build-args
65+
command: solr-precreate archivesspace /opt/solr/server/solr/configsets/archivesspace
5866
environment:
67+
# @see https://docs.archivesspace.org/provisioning/solr/#setup-the-environment
68+
- SOLR_MODULES=analysis-extras
5969
# Eliminates "failed to reserve shared memory" warning
6070
# @see https://support.pingidentity.com/s/article/Addressing-Failed-to-reserve-shared-memory-errors
61-
GC_TUNE: -XX:-UseLargePages
71+
- GC_TUNE=-XX:-UseLargePages
6272
ports:
6373
- 8983:8983
64-
command: solr-precreate archivesspace /opt/solr/server/solr/configsets/archivesspace
6574
volumes:
66-
- ./solr:/opt/solr-8.11.2/server/solr/configsets/archivesspace/conf:ro
67-
- solr_data:/var/solr/data
75+
- solr_data:/var/solr
6876
healthcheck:
6977
test: curl --max-time 10 -f http://localhost:8983/solr/#/~cores/archivesspace || exit 1
7078
start_period: 10s
@@ -74,9 +82,6 @@ services:
7482

7583
db:
7684
image: mariadb:10.9
77-
depends_on:
78-
solr:
79-
condition: service_healthy
8085
environment:
8186
# @note These are all hardcoded for convenience
8287
- MYSQL_ROOT_PASSWORD=archivesspace-root
@@ -85,19 +90,22 @@ services:
8590
- MYSQL_PASSWORD=archivesspace
8691
ports:
8792
- 3306:3306
93+
secrets:
94+
- source: root-my.cnf
95+
target: /root/.my.cnf
8896
volumes:
97+
- ./db/dumps:/docker-entrypoint-initdb.d:ro
8998
- db_data:/var/lib/mysql
90-
- ./init:/docker-entrypoint-initdb.d
9199

92100
configs:
93-
config.rb:
94-
file: files/config/config.rb
95101
en-locales.yml:
96102
file: files/locales/enums/en.yml
97103

98104
secrets:
99105
APPCONFIG_DB_URL:
100106
environment: APPCONFIG_DB_URL
107+
root-my.cnf:
108+
file: files/root-my.cnf
101109

102110
volumes:
103111
aspace_data: {}
File renamed without changes.

files/root-my.cnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[client]
2+
user = root
3+
password = archivesspace-root

solr/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM solr:9
2+
3+
ARG ARCHIVESSPACE_VERSION="v4.1.1"
4+
ENV ARCHIVESSPACE_SOURCE_URL="https://github.com/archivesspace/archivesspace/releases/download/${ARCHIVESSPACE_VERSION}/archivesspace-${ARCHIVESSPACE_VERSION}.zip"
5+
6+
# Upgrade system packages and install wget
7+
USER root
8+
RUN apt-get -y update && \
9+
apt-get -y upgrade && \
10+
apt-get -y install --no-install-recommends \
11+
unzip \
12+
wget && \
13+
rm -rf /var/lib/apt/lists/*
14+
15+
# Create a configset for the given ASpace release
16+
RUN mkdir -p /opt/solr/server/solr/configsets/archivesspace/conf && \
17+
wget -O aspace.zip "$ARCHIVESSPACE_SOURCE_URL" && \
18+
unzip aspace.zip 'archivesspace/solr/*' && \
19+
mv archivesspace/solr/* /opt/solr/server/solr/configsets/archivesspace/conf/ && \
20+
rm -rf aspace.zip archivesspace
21+
USER solr

0 commit comments

Comments
 (0)