diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c770d07 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +run: + ./gradlew bootRun + +docker-build: + ./gradlew clean build + docker build -t dashboard-dev --file sbdi/dev.Dockerfile . + +docker-run: + docker run -p 8080:8080 --rm --name dashboard-dev dashboard-dev diff --git a/sbdi/README.md b/sbdi/README.md new file mode 100644 index 0000000..0d02e2c --- /dev/null +++ b/sbdi/README.md @@ -0,0 +1,27 @@ +# Dashboard + +## Setup + +Create data directory at `/data/dashboard` and populate as below (it is easiest to symlink the config files to the ones in this repo): +``` +mats@xps-13:/data/dashboard$ tree +. +├── config +│ ├── dashboard-config.properties -> /home/mats/src/biodiversitydata-se/dashboard/sbdi/data/config/dashboard-config.properties +├── csv +├── data.json -> /home/mats/src/biodiversitydata-se/dashboard/sbdi/data/data.json +└── zip +``` + +## Usage + +Run locally: +``` +make run +``` + +Build and run in Docker (using Tomcat): +``` +make docker-build +make docker-run +``` diff --git a/sbdi/dev.Dockerfile b/sbdi/dev.Dockerfile new file mode 100644 index 0000000..7dded0c --- /dev/null +++ b/sbdi/dev.Dockerfile @@ -0,0 +1,11 @@ +FROM tomcat:9.0-jdk11-temurin + +RUN mkdir -p \ + /data/dashboard/config \ + /data/dashboard/csv \ + /data/dashboard/zip + +COPY sbdi/data/data.json /data/dashboard/data.json +COPY sbdi/data/config/dashboard-config.properties /data/dashboard/config/dashboard-config.properties + +COPY build/libs/dashboard-2.5.0-plain.war $CATALINA_HOME/webapps/ROOT.war