-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combined frontend + blacklab-proxy Docker image (#437)
Docker image that adds frontend to BLS's.
- Loading branch information
1 parent
9091082
commit a272e31
Showing
7 changed files
with
115 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Ignore these when building Docker image | ||
**/.env | ||
**/target | ||
|
||
**/.settings | ||
**/.idea | ||
**/*.iml | ||
**/.vscode | ||
**/doc | ||
/*.md | ||
**/README.md | ||
**/.project | ||
**/.classpath | ||
**/.factorypath | ||
**/.apt_generated/ | ||
**/.apt_generated_tests/ | ||
|
||
.git | ||
|
||
# vi temporary files | ||
**/*.swp | ||
|
||
# log files, such as JVM crash files | ||
**/*.log | ||
|
||
# Ignore docker files, we don't need these inside the container. | ||
**/Dockerfile | ||
**/*.dockerfile | ||
**/.dockerignore | ||
**/docker-compose*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Development overrides for BLS+frontend Compose | ||
version: '3.9' | ||
|
||
services: | ||
|
||
frontend: | ||
# Bind mount properties file for quick updates during development | ||
volumes: | ||
- ./docker/config/corpus-frontend.properties:/etc/blacklab/corpus-frontend.properties | ||
|
||
frontend-proxy: | ||
# Bind mount properties file for quick updates during development | ||
volumes: | ||
- ./docker/config/corpus-frontend.properties:/etc/blacklab/corpus-frontend.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
# use this docker-compose file to connect corpus-frontend to an existing blacklab-server | ||
# assume the blacklab-server was created using docker-compose.yml from the blacklab repo with project name 'blacklab' | ||
# it will have created a network named blacklab_default | ||
# Run a container with both BlackLab Frontend and Server | ||
version: '3.9' | ||
|
||
services: | ||
|
||
frontend: | ||
image: instituutnederlandsetaal/blacklab-corpus-frontend:${IMAGE_VERSION} | ||
image: instituutnederlandsetaal/blacklab-frontend:${IMAGE_VERSION} | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile | ||
volumes: | ||
- ./docker/config/corpus-frontend.properties:/etc/blacklab/corpus-frontend.properties | ||
context: . | ||
dockerfile: docker/frontend-bls.dockerfile | ||
ports: | ||
- "8081:8080" # 8080 will be used by blacklab-server | ||
- "8080:8080" # frontend and BLS will both be available on 8080 | ||
volumes: | ||
# Default values have no effect, but user can override CORPUS_DIR/_NAME to bind mount corpus | ||
- ${CORPUS_DIR:-./README.md}:/data/index/${CORPUS_NAME:-README.md} | ||
|
||
networks: | ||
default: | ||
external: | ||
name: blacklab_default # network defined in blacklab-server's docker-compose.yml | ||
frontend-proxy: | ||
profiles: [ "proxy" ] # don't start this by default | ||
image: instituutnederlandsetaal/blacklab-frontend-proxy:${IMAGE_VERSION} | ||
build: | ||
context: . | ||
dockerfile: docker/frontend-proxy.dockerfile | ||
ports: | ||
- "8080:8080" # frontend and BLS will both be available on 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Stage "builder": build the WAR file | ||
#-------------------------------------- | ||
FROM maven:3.6-jdk-11 AS builder | ||
|
||
# Copy source | ||
WORKDIR /app | ||
COPY . . | ||
|
||
# Build the WAR. | ||
# NOTE: make sure BuildKit is enabled (see https://docs.docker.com/develop/develop-images/build_enhancements/) | ||
# to be able to cache Maven libs so they aren't re-downloaded every time you build the image | ||
RUN --mount=type=cache,target=/root/.m2 mvn --no-transfer-progress package | ||
|
||
|
||
# Tomcat container with the WAR file | ||
#-------------------------------------- | ||
FROM instituutnederlandsetaal/blacklab-proxy:latest | ||
|
||
# Where corpus-frontend.properties can be found. Can be overridden. | ||
ARG CONFIG_ROOT=docker/config | ||
|
||
# What the name of the Tomcat app (and therefore the URL should be). Can be overridden. | ||
ARG TOMCAT_APP_NAME=corpus-frontend | ||
|
||
COPY ${CONFIG_ROOT}/corpus-frontend.properties /etc/blacklab/ | ||
|
||
# Copy the WAR file | ||
COPY --from=builder /app/target/corpus-frontend-*.war /usr/local/tomcat/webapps/${TOMCAT_APP_NAME}.war |