Skip to content

Commit

Permalink
Align Docker input/output path with defaults
Browse files Browse the repository at this point in the history
Close #454
  • Loading branch information
nichtich committed May 30, 2024
1 parent 2c5718b commit fdbe0b0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ RUN cd /opt \
&& unzip qa-catalogue-${QA_CATALOGUE_VERSION}-release.zip \
&& rm qa-catalogue-${QA_CATALOGUE_VERSION}-release.zip \
&& mv qa-catalogue-${QA_CATALOGUE_VERSION} qa-catalogue \
&& mv /opt/qa-catalogue/setdir.sh.template /opt/qa-catalogue/setdir.sh \
&& mkdir -p /opt/qa-catalogue/marc \
&& sed -i.bak 's,BASE_INPUT_DIR=./input,BASE_INPUT_DIR=/opt/qa-catalogue/marc,' /opt/qa-catalogue/setdir.sh \
&& sed -i.bak 's,BASE_OUTPUT_DIR=./output,BASE_OUTPUT_DIR=/opt/qa-catalogue/marc/_output,' /opt/qa-catalogue/setdir.sh \
# install web application
&& apt-get update \
&& mkdir -p /opt/qa-catalogue/input /opt/qa-catalogue/output

# install web application
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
apache2 \
Expand All @@ -77,9 +75,7 @@ RUN cd /opt \
unzip \
composer \
gettext \
&& locale-gen en_GB.UTF-8 \
&& locale-gen de_DE.UTF-8 \
&& locale-gen pt_BR.UTF-8 \
&& locale-gen en_GB.UTF-8 && locale-gen de_DE.UTF-8 && locale-gen pt_BR.UTF-8 \
&& apt-get --assume-yes autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& cd /var/www/html/ \
Expand All @@ -94,12 +90,11 @@ RUN cd /opt \
&& ls -la \
&& unzip -q master.zip \
&& rm master.zip \
# && mv qa-catalogue-web-0.4 qa-catalogue \
&& mv qa-catalogue-web-${QA_CATALOGUE_WEB_VERSION} qa-catalogue \
&& cd qa-catalogue \
&& composer install \
&& mkdir config \
&& echo dir=/opt/qa-catalogue/marc/_output > /var/www/html/qa-catalogue/configuration.cnf \
&& echo dir=/opt/qa-catalogue/output > /var/www/html/qa-catalogue/configuration.cnf \
&& echo include=config/configuration.cnf >> /var/www/html/qa-catalogue/configuration.cnf \
# && cp /var/www/html/qa-catalogue/configuration.js.template /var/www/html/qa-catalogue/configuration.js \
&& touch /var/www/html/qa-catalogue/selected-facets.js \
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ can be configured with the following environment variables:

- `CONTAINER`: the name of the docker container. Default: `metadata-qa-marc`.

- `INPUT`: Base directory to put your bibliographic record files in subdirectory
`qa-catalogue`. Set to `./input` by default, so record files are expected to
be in `input/qa-catalogue`.
- `INPUT`: Base directory to put your bibliographic record files in subdirectories of.
Set to `./input` by default, so record files are expected to be in `input/$NAME`.

- `OUTPUT`: Base directory to put result of qa-catalogue in subdirectory of.
Set to `./output` by default, so files are put in `output/$NAME`.

- `WEBCONFIG`: directory to expose configuration of [qa-catalogue-web]. Set to
`./web-config` by default. If using non-default configuration for data analysis
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ services:
app:
image: ${IMAGE:-pkiraly/metadata-qa-marc}
volumes:
- ./${INPUT:-input}:/opt/qa-catalogue/marc
- ./${INPUT:-input}:/opt/qa-catalogue/input
- ./${OUTPUT:-output}:/opt/qa-catalogue/output
- ./${WEBBCONFIG:-web-config}:/var/www/html/qa-catalogue/config
- /etc/timezone:/etc/timezone:ro # Sync timezone
- /etc/localtime:/etc/localtime:ro # Sync localtime
- /etc/timezone:/etc/timezone:ro # Sync timezone
- /etc/localtime:/etc/localtime:ro # Sync localtime
ports:
- "${WEBPORT:-80}:80" # qa-catalogue-web
- "${SOLRPORT:-8983}:8983" # Solr
Expand Down
2 changes: 1 addition & 1 deletion docker/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Used to create the base image with `docker compose build app`

version: '2'
version: '3'

services:
app:
Expand Down
2 changes: 0 additions & 2 deletions docker/qa-catalogue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ else
-e TYPE_PARAMS="${TYPE_PARAMS:-}" \
-e UPDATE="${UPDATE:-}" \
-e VERSION="${VERSION:-}" \
-e BASE_INPUT_DIR=/opt/qa-catalogue/marc \
-e BASE_OUTPUT_DIR=/opt/qa-catalogue/marc/_output \
"$CONTAINER" \
./qa-catalogue \
"${args[@]}"
Expand Down

0 comments on commit fdbe0b0

Please sign in to comment.