summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-server/Dockerfile
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-07-30 12:15:10 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:54:44 +0200
commita01f964b531f12fd89cbdb0f2132aecbfaebf546 (patch)
tree4a2c3795d3d1ae394e9ab785b9229ab6e14ccbdf /opendc-web/opendc-web-server/Dockerfile
parent41b0ed59421b301bac652e47d1a2909145aa5936 (diff)
refactor(web/server): Create standalone OpenDC distribution
This change updates the Quarkus configuration of the OpenDC web server to serve as a fully standalone distribution that is capable of serving the web UI, web API, and experiment runner. Such an approach vastly simplifies local deployments. For Docker deployments, we create a custom Quarkus profile that uses PostgreSQL and disables the web UI.
Diffstat (limited to 'opendc-web/opendc-web-server/Dockerfile')
-rw-r--r--opendc-web/opendc-web-server/Dockerfile17
1 files changed, 17 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-server/Dockerfile b/opendc-web/opendc-web-server/Dockerfile
new file mode 100644
index 00000000..444d787e
--- /dev/null
+++ b/opendc-web/opendc-web-server/Dockerfile
@@ -0,0 +1,17 @@
+FROM openjdk:17-slim
+MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
+
+# Obtain (cache) Gradle wrapper
+COPY gradlew /app/
+COPY gradle /app/gradle
+WORKDIR /app
+RUN ./gradlew --version
+
+# Build project
+COPY ./ /app/
+RUN ./gradlew --no-daemon :opendc-web:opendc-web-server:quarkusBuild -Dquarkus.profile=docker
+
+FROM openjdk:17-slim
+COPY --from=0 /app/opendc-web/opendc-web-server/build/quarkus-app /opt/opendc
+WORKDIR /opt/opendc
+CMD java -jar quarkus-run.jar