The purpose of this project is to provide docker images for bwHealthCloud.
Make sure that latest release files are in the project directory, as docker build will pick them up without downloading them.
Latest frontend release file will be downloaded from https://bwhealthcloud.de.
This project contains two files for use with frontend and backend Frontend.Dockerfile
and Backend.Dockerfile
.
Both of them use build arguments to customize build on build time.
To build the image for bwHealthCloud frontend, use the following command
docker build -t bwhc-frontend -f Frontend.Dockerfile .
This will create the image using default build arguments and mark it as bwhc-frontend
. To customize the build, specify custom values.
VERSION
: The version to be used. Current value2209
. Required for use with local release zip file.NUXT_HOST
andNUXT_PORT
: Server configuration, see 2.3 of bwHC manual for more information.BACKEND_PROTOCOL
,BACKEND_HOSTNAME
andBACKEND_PORT
: Backend access, see 2.4 of bwHC manual for more information.
e.g.:
docker build -t bwhc-frontend -f Frontend.Dockerfile --build-arg NUXT_PORT=1234 .
To build the image for bwHealthCloud backend, use the following command
docker build -t bwhc-backend -f Backend.Dockerfile .
This will create the image with the default build arguments and mark it as bwhc-backend
. To customize the build, specify custom values.
VERSION
: The version to be used. Current value2209
BWHC_BASE_DIR
: The directory to hold the application and config files. This value defaults to/bwhc-backend
. Changing this value requires changing paths in exampledocker-compose.yml
.
e.g.:
docker build -t bwhc-backend -f Backend.Dockerfile --build-arg BWHC_BASE_DIR=/opt/bwhc-backend .
Both images can be started like any other docker image. Make sure you provide required docker volumes to keep data after service recreation.
The backend image uses two volumes relative to $BWHC_BASE_DIR
provided at build time: $BWHC_BASE_DIR/data
and $BWHC_BASE_DIR/hgnc_data
.
This project provides support for Docker Compose. So it is possible to build and run frontend and backend using Docker compose.
To use custom logging configuration in logback.xml
and/or custom bwhcConnectorConfig.xml
for backend,
mount these files as readonly volumes or docker configuration to $BWHC_BASE_DIR/logback.xml
and $BWHC_BASE_DIR/bwhcConnectorConfig.xml
.
docker run -v $PWD/bwhcConnectorConfig.xml:/bwhc-backend/bwhcConnectorConfig.xml:ro
Or using docker-compose like so:
...
services:
backend:
# ... other settings ...
volumes:
- "./bwhcConnectorConfig.xml:/bwhc-backend/bwhcConnectorConfig.xml:ro"
...
To use configuration files as docker config create a new docker config from configuration file.
docker config create bwhcConnectorConfig bwhcConnectorConfig.xml
Using docker-compose, change docker-compose file to contain entries like so.
configs:
bwhcConnectorConfig:
external: true
...
services:
backend:
# ... other settings ...
configs:
- source: bwhcConnectorConfig
target: /bwhc-backend/bwhcConnectorConfig.xml
...
The image for bwHealthCloud Frontend starts as expected, using configured build arguments and environment variables at build time. Since frontends access to the backend is configured at build time, it is not required to provide environment variables at runtime.
The bwHealthCloud Backend image starts using play start script provided by application. I have not tested if there are any issues running the backend in addition to login.