docker container

This commit is contained in:
2024-07-07 15:20:15 +02:00
parent 2df3a3dccb
commit e00aff5e5a
6 changed files with 73 additions and 3 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
**/.parcel-cache
**/dist
**/node_modules
**/target

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
FROM node:20-bullseye as webui-build
WORKDIR /usr/src/app/webui-build
COPY ./webui/package*.json ./
RUN npm i
COPY ./webui/. .
RUN npm run build
FROM azul/zulu-openjdk:21 as server-build
WORKDIR /usr/src/app/server-build
COPY ./server/.mvn .mvn
COPY ./server/mvnw ./server/pom.xml ./
RUN ./mvnw quarkus:go-offline
# The previous thing still doesn't download 100% everything
RUN ./mvnw -Dmaven.test.skip=true -Dskip.unit=true package --fail-never
COPY ./server/. .
RUN ./mvnw -Dmaven.test.skip=true -Dskip.unit=true clean package
FROM azul/zulu-openjdk-alpine:21
RUN apk update && apk add fuse && rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY --from=server-build /usr/src/app/server-build/target/quarkus-app/. .
RUN mkdir -p webui
COPY --from=webui-build /usr/src/app/webui-build/dist/. ./webui
ENV dhfs_webui_root=/usr/src/app/webui
COPY ./dockerentry.sh .
RUN ["chmod", "+x", "./dockerentry.sh"]
CMD [ "./dockerentry.sh" ]

View File

@@ -0,0 +1,23 @@
version: "3.2"
services:
dhfs1:
build: .
privileged: true
devices:
- /dev/fuse
command: "./dockerentry.sh -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5010"
ports:
- 8080:8080
- 8081:8443
- 5005:5005
dhfs2:
build: .
privileged: true
devices:
- /dev/fuse
command: "./dockerentry.sh -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5010"
ports:
- 8090:8080
- 8091:8443
- 5010:5010

10
dockerentry.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
exec java \
--add-exports java.base/sun.nio.ch=ALL-UNNAMED \
-Ddhfs.objects.persistence.files.root=/dhfs_root/p \
-Ddhfs.objects.distributed.root=/dhfs_root/d \
-Ddhfs.fuse.root=/dhfs_root_fuse \
-Dquarkus.http.host=0.0.0.0 \
"$@" \
-jar quarkus-run.jar

View File

@@ -20,6 +20,7 @@ public class WebUiRouter {
void installRoute(@Observes StartupEvent startupEvent, Router router) { void installRoute(@Observes StartupEvent startupEvent, Router router) {
root.ifPresent(r -> { root.ifPresent(r -> {
router.route().path("/").handler(ctx -> ctx.redirect("/webui"));
router.route() router.route()
.path("/webui/*") .path("/webui/*")
.handler(this::handle); .handler(this::handle);

View File

@@ -1,3 +0,0 @@
.parcel-cache
dist
node_modules