D
Dokployβ€’9mo ago
tschuehly

Running Spring Boot on Dokploy

Hello πŸ‘‹ , Dokploy looks really cool! I'm trying to run a Spring Boot Application on Dokploy. First I wanted to use Paketo Buildpacks as this is the default for Spring Boot. It seems to want to use Java 17: Using buildpack default Java version 17 I tried setting BP_JAVA_VERSION=21 in my env variables, but this doesn't seem to be a build time variable, as it still tried with Java 17 I then tried with Heroku Buildpacks: This built successfully but failed on startup: ERROR: failed to launch: determine start command: when there is no default process a command is required This should be java -Dserver.port=$PORT $JAVA_OPTS -jar build/libs/*.jar https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku#default-web-process-type
Deploying Gradle Apps on Heroku | Heroku Dev Center
Creating, configuring, deploying and scaling Java applications on Heroku using Gradle.
34 Replies
tschuehly
tschuehlyOPβ€’9mo ago
Using Nixpacks, the same thing happens:
#10 92.13 Execution failed for task ':compileJava'.
#10 92.13 > error: invalid source release: 21
#10 92.13 Execution failed for task ':compileJava'.
#10 92.13 > error: invalid source release: 21
@Siumauricio Happy to help if you need help with the Java stuff
Siumauricio
Siumauricioβ€’9mo ago
I’m not familiar with Java spring boot This is the docs, https://nixpacks.com/docs/providers/java Do you have a repo to test this?
Java | Nixpacks
App source + Nix packages + Docker = Image
Siumauricio
Siumauricioβ€’9mo ago
Maybe testing I can find the solution
tschuehly
tschuehlyOPβ€’9mo ago
It needs to be possible to set a build time variable for nixpacks: NIXPACKS_JDK_VERSION and for paketo buildpacks the one at the top Or just set it always to the newest jdk, they are downwards compatible
Siumauricio
Siumauricioβ€’9mo ago
do you have a repo to test it?
tschuehly
tschuehlyOPβ€’9mo ago
Yep wait I'll just test it
tschuehly
tschuehlyOPβ€’9mo ago
GitHub
GitHub - tschuehly/hyperspring-demo
Contribute to tschuehly/hyperspring-demo development by creating an account on GitHub.
tschuehly
tschuehlyOPβ€’9mo ago
This one in Kotlin but has the same problem
Siumauricio
Siumauricioβ€’9mo ago
Thanks, I will try in the night !
tschuehly
tschuehlyOPβ€’7mo ago
Hey there, is it possible now to set a build time environment variable? I would like to create a blogpost about dokploy aswell
Siumauricio
Siumauricioβ€’7mo ago
For build environment you can use the dockerfile builder When you use the dockerfile builder in the environment tab it will unlock a Builds envs field
tschuehly
tschuehlyOPβ€’7mo ago
But I would like to use paketo buildpacks. It's the default for spring
Siumauricio
Siumauricioβ€’7mo ago
I remember for every builder we pass the same envs as args to the paketo builder
tschuehly
tschuehlyOPβ€’7mo ago
Yeah but I cannot build my Java 23 project, because it uses the Java 17 builder
Siumauricio
Siumauricioβ€’7mo ago
Have you tried to set that envs in the environment tab?
tschuehly
tschuehlyOPβ€’7mo ago
I did when I first asked, let me try again It doesn't apply to the builder Just tried it out
Siumauricio
Siumauricioβ€’7mo ago
Hmmm let me check the code How did you set the env can you paste it?
tschuehly
tschuehlyOPβ€’7mo ago
BP_JAVA_VERSION=21
tschuehly
tschuehlyOPβ€’7mo ago
No description
Siumauricio
Siumauricioβ€’7mo ago
let me test it
tschuehly
tschuehlyOPβ€’7mo ago
No description
tschuehly
tschuehlyOPβ€’7mo ago
You can see it in the deployment logs
Siumauricio
Siumauricioβ€’7mo ago
in the logs they looks like they are using java 19.0 for example
custom Java Flight Recording (JFR) arguments
$BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
$BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
$BPL_JMX_PORT 5000 configure the JMX port
$BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
$BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
$BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
$JAVA_TOOL_OPTIONS the JVM launch flags
Using Java version 19.0 from BP_JVM_VERSION

Paketo Buildpack for BellSoft Liberica 10.9.0
unable to find dependency
no valid dependencies for jdk, 19.0, and io.buildpacks.stacks.jammy in [(jdk, 8.0.422, [*]) (jre, 8.0.422, [*]) (jdk, 11.0.24, [*]) (jre, 11.0.24, [*]) (native-image-svm, 11.0.22, [*]) (jdk, 17.0.12, [*]) (jre, 17.0.12, [*]) (native-image-svm, 17.0.12, [*]) (jdk, 21.0.4, [*]) (jre, 21.0.4, [*]) (native-image-svm, 23.0.0, [*]) (jdk, 23.0.0, [*]) (jre, 23.0.0, [*]) (native-image-svm, 21.0.4, [*]) (jdk, 8.0.422, [*]) (jre, 8.0.422, [*]) (jdk, 11.0.24, [*]) (jre, 11.0.24, [*]) (native-image-svm, 11.0.22, [*]) (jdk, 17.0.12, [*]) (jre, 17.0.12, [*]) (native-image-svm, 17.0.12, [*]) (jdk, 21.0.4, [*]) (jre, 21.0.4, [*]) (native-image-svm, 21.0.4, [*]) (jdk, 23.0.0, [*]) (jre, 23.0.0, [*]) (native-image-svm, 23.0.0, [*])]
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
Error ❌
custom Java Flight Recording (JFR) arguments
$BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
$BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
$BPL_JMX_PORT 5000 configure the JMX port
$BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
$BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
$BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
$JAVA_TOOL_OPTIONS the JVM launch flags
Using Java version 19.0 from BP_JVM_VERSION

Paketo Buildpack for BellSoft Liberica 10.9.0
unable to find dependency
no valid dependencies for jdk, 19.0, and io.buildpacks.stacks.jammy in [(jdk, 8.0.422, [*]) (jre, 8.0.422, [*]) (jdk, 11.0.24, [*]) (jre, 11.0.24, [*]) (native-image-svm, 11.0.22, [*]) (jdk, 17.0.12, [*]) (jre, 17.0.12, [*]) (native-image-svm, 17.0.12, [*]) (jdk, 21.0.4, [*]) (jre, 21.0.4, [*]) (native-image-svm, 23.0.0, [*]) (jdk, 23.0.0, [*]) (jre, 23.0.0, [*]) (native-image-svm, 21.0.4, [*]) (jdk, 8.0.422, [*]) (jre, 8.0.422, [*]) (jdk, 11.0.24, [*]) (jre, 11.0.24, [*]) (native-image-svm, 11.0.22, [*]) (jdk, 17.0.12, [*]) (jre, 17.0.12, [*]) (native-image-svm, 17.0.12, [*]) (jdk, 21.0.4, [*]) (jre, 21.0.4, [*]) (native-image-svm, 21.0.4, [*]) (jdk, 23.0.0, [*]) (jre, 23.0.0, [*]) (native-image-svm, 23.0.0, [*])]
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
Error ❌
I used this env BP_JVM_VERSION=19.0 that errors below are other things but in the logs said Using Java version 19.0 from BP_JVM_VERSION
tschuehly
tschuehlyOPβ€’7mo ago
let me try oh I can't read πŸ˜„
Siumauricio
Siumauricioβ€’7mo ago
xD did it work?
tschuehly
tschuehlyOPβ€’7mo ago
seems to work πŸ˜„ I would like to support you, when I do it with opencollective, I get a link to my saas?
Siumauricio
Siumauricioβ€’7mo ago
Yes, just send me the link of your business and I will put in the readme and website!
tschuehly
tschuehlyOPβ€’7mo ago
done
tschuehly
tschuehlyOPβ€’7mo ago
Interaktives Hochzeits-Fotospiel fΓΌr unvergessliche Momente
Entdecken Sie PhotoQuest: Das innovative Hochzeits-Fotospiel, das Ihre GΓ€ste vernetzt und Ihr Fest belebt. Erstellen Sie ein einzigartiges Fotobuch mit spaßigen Aufgaben, Bildergalerie und Live-Slideshow. Jetzt ab 99,99€!
Siumauricio
Siumauricioβ€’7mo ago
Thank youuu I will add now!
tschuehly
tschuehlyOPβ€’7mo ago
nice
Siumauricio
Siumauricioβ€’7mo ago
do you have any logo url?

Did you find this page helpful?