R
Railway8mo ago
krish

Error: Unable to access jarfile target/*jar

https://job-seeking-production.up.railway.app I'm using spring boot application with mysql ..all process done but it application failed to respond that i hava use dockerfile
34 Replies
Brody
Brody8mo ago
you say spring boot, but then why do you also have uvicorn in there?
krish
krish8mo ago
ok what i do
Brody
Brody8mo ago
explain why you have it like that, what is uvicorn doing in a dockerfile for a spring boot app? uvicorn is typically used to run fastapi python apps
krish
krish8mo ago
ok ,that is 1st time i try to deploy the application so i try all method
Brody
Brody8mo ago
do you use python at all in this project?
krish
krish8mo ago
no
Brody
Brody8mo ago
then I don't see the purpose of including uvicorn
krish
krish8mo ago
ok now i remove it
Brody
Brody8mo ago
okay
krish
krish8mo ago
ok,what keyword to use for host and post in docker hello brody help me man CMD webservice:app --host 0.0.0.0 --port $PORT
Brody
Brody8mo ago
you said you didn't use python at all in this project, why are you using uvicorn?? do you use python in this project, yes or no
krish
krish8mo ago
no
Brody
Brody8mo ago
okay your CMD keyword should start the java server
krish
krish8mo ago
okay what keyword should i used FROM maven:3-openjdk-17 AS build COPY . . RUN mvn clean package -DskipTests FROM openjdk:17.0.1-jdk-slim COPY --from=build /target/jobseeking-0.0.1-SNAPSHOT.war jobseeking.war EXPOSE 8080 ENTRYPOINT ["java", "-jar", "jobseeking.war"]
Brody
Brody8mo ago
why even use a dockerfile? maybe nixpacks can build your app just fine
krish
krish8mo ago
ok, how to use nixpacks ?
Brody
Brody8mo ago
remove the dockerfile
krish
krish8mo ago
now show like that brody
No description
krish
krish8mo ago
bro are you there?
Brody
Brody8mo ago
are you building a jar file? if so, you likely have your paths wrong when you build or run the jar file
krish
krish8mo ago
how to correct the paths
Brody
Brody8mo ago
i strongly recommend you familurelize yourself with the technologies you are trying to use
krish
krish8mo ago
Can you tell me the way to learn this technique?
Brody
Brody8mo ago
same way you learn anything now-a-days, youtube videos
krish
krish8mo ago
Any youtube videos you recommend?
Brody
Brody8mo ago
i dont know java and i dont personally watch programming youtube videos anyway
krish
krish8mo ago
Where do you learn from?
Brody
Brody8mo ago
stack overflow
krish
krish8mo ago
it successfully run but it show application failed to response
No description
krish
krish8mo ago
brody thank it's done
Brody
Brody8mo ago
awesome
Brody
Brody8mo ago
thank you