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
35 Replies
you say spring boot, but then why do you also have uvicorn in there?
ok what i do
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
ok ,that is 1st time i try to deploy the application
so i try all method
do you use python at all in this project?
no
then I don't see the purpose of including uvicorn
ok
now i remove it
okay
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
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
no
okay
your CMD keyword should start the java server
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"]
why even use a dockerfile? maybe nixpacks can build your app just fine
ok, how to use nixpacks ?
remove the dockerfile
now show like that brody
bro
are you there?
are you building a jar file? if so, you likely have your paths wrong when you build or run the jar file
how to correct the paths
i strongly recommend you familurelize yourself with the technologies you are trying to use
Can you tell me the way to learn this technique?
same way you learn anything now-a-days, youtube videos
Any youtube videos you recommend?
i dont know java and i dont personally watch programming youtube videos anyway
Where do you learn from?
stack overflow
it successfully run but it show application failed to response
please read this https://docs.railway.app/troubleshoot/fixing-common-errors
brody thank it's done
awesome
thank you
49a1e42c-c61d-4f9c-973d-8528e0cf1a81