Deployment Help :.)
hello friends !
i have a noob question to ask , i have my frontend , my resource server and my authentication server.
how do i deploy it using railway 😮
ive only dont it with frontend and back + persistence . but never with the additional authentication server
48 Replies
Project ID:
N/A
N/A
what is the tech stack of the frontend and backend?
its angular
springboot and mysql
i think tahts about it
what did you need help with exactly, do you know how to deploy an singular app to railway?
I used to just ng build , put the statics into the backend and like docker image then build it up , set up the persistence with the buttons
but ! this time i have an authorisation server so idk how to incoroporate it
anyways brody i really appreciate your help!
and this authorization server is separate from your backend, correct?
yes
then that makes 4 services, meaning you need 4 railway services in the same project
frontend
backend
database
auth
for example?
something like this ?
yep
what kind of angular app is this? 16, 17? CSR, SSR?
how do i know if they are all connected?
ok i shall give it a go first >:3
angular 17
there's no physical connections, for example, your frontend would make api calls to the backend's public domain
ahh okok !! ill give it a try first~ thanks so much for your help!
no problem
do you have a proper way to run your angular app on railway? angular alone doesn't come with a production ready web server and railway can only run your code as-is therefore railway would run the development server and that is quite costly
hey man
im finally ready to deploy
was wonding if you could help me witht hat
yes, please don't open duplicate threads
hi !
apologies for the long winded
approach! i could really use ur help solving this
Failed to bind properties under 'spring.datasource.hikari' to com.zaxxer.hikari.HikariDataSource:
Property: spring.datasource.hikari.pool-name
Value: data-source
show me your service variables please
make sure you have the correct drivers installed for your datasource
im using com.mysql.cj.jdbc.Driver
make sure its being installed
how do i do that?
i thoughti can just make a docker file and railway it up
sorry im new to this
lets see the dockerfile
FROM maven:3.6-adoptopenjdk-11 AS build
WORKDIR /app
COPY pom.xml .
COPY src src
copy target target
RUN mvn package -Dmaven.test.skip=true
FROM adoptopenjdk:11-jre-hotspot
WORKDIR /app
COPY --from=build /app/target/server-0.0.1-SNAPSHOT.jar app.jar
ENV PORT=8081 \
SPRING_DATASOURCE_URL= \
SPRING_DATASOURCE_USERNAME= \
SPRING_DATASOURCE_PASSWORD= \
SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver \
SPRING_DATASOURCE_HIKARI_CONNECTION_TIMEOUT=60000 \
SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=2 \
SPRING_DATASOURCE_HIKARI_MINIMUM_IDLE=1 \
SPRING_DATASOURCE_HIKARI_POOL_NAME=data-source \
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect \
SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL=true \
LOGGING_LEVEL_ORG_HIBERNATE_SQL=INFO \
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY=DEBUG \
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_OAUTH2=DEBUG \
SPRINGDOC_SWAGGER_UI_TAGS_SORTER=alpha
EXPOSE ${PORT}
ENTRYPOINT java -jar app.jar
remove all those ENVs, they should be defined as service variables
FROM maven:3.6-adoptopenjdk-11 AS build
WORKDIR /app
COPY pom.xml .
COPY src src
copy target target
RUN mvn package -Dmaven.test.skip=true
FROM adoptopenjdk:11-jre-hotspot
WORKDIR /app
COPY --from=build /app/target/server-0.0.1-SNAPSHOT.jar app.jar
ENV PORT=8081
EXPOSE ${PORT} ENTRYPOINT java -jar app.jar like this ?
EXPOSE ${PORT} ENTRYPOINT java -jar app.jar like this ?
make sure to enclose code blocks in tripple back ticks
remove -
its not needed
okay , thank you. do i try it now?
yes
Build Logs: https://railway.app/project/b41ad513-db0e-47b7-a080-0720eeee3a69/service/a22e5b4c-e962-41d3-9591-543e034cbd14?id=4f4294d4-345f-40cf-b54e-2a31fa929d79&
Failed to stream deploy logs: TLS error: webpki error: UnsupportedCriticalExtension
Failed to stream build logs: TLS error: webpki error: UnsupportedCriticalExtension
i got this
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
is it okay ?
thats an issue with your os, your build would still be running though
logs too!
Description:
Failed to bind properties under 'spring.datasource.hikari' to com.zaxxer.hikari.HikariDataSource:
Property: spring.datasource.hikari.pool-name
Value: data-source
Origin: System Environment Property "SPRING_DATASOURCE_HIKARI_POOL_NAME"
i got the same error
enclose your logs in tripple backticks too
sorry i dont understand
is it possible if i called you to solve this?
sorry I wouldn't be able to offer that level of support
this wouldn't be a railway issue, have you tried researching this error?
okay , i will try researching on my own! ill let you know how it goes ty brody, mb for tilting you so much
it still doesnt work idk why docker cant find my hikari pool name value data-source. it is in my application properties and it works locally
i tried changing it to "data-source" in docker variables
hello brody
i may have found the solution but im not sure its not crashing anymore but idk if the server is up
remove the spring pool name
and just use the one they gave
Request URL:
https://shoely.up.railway.app/api/public/product/recent
Request Method:
GET
Status Code:
503 Service Unavailable
Referrer Policy:
strict-origin-when-cross-origin
Content-Length:
2942
Content-Type:
text/html
Date:
Tue, 16 Apr 2024 18:55:49 GMT
Server:
railway
X-Railway-Fallback:
true
why ami getting this?
nothing is showing up on my logs
please read this docs page -
https://docs.railway.app/guides/fixing-common-errors
No not this i cannot connect to my back end on railway
i have hosted my front end on vercel and my backend applicaion as well as well as my auth server on railway
and right now my front end cannot connect to servers in railway
please read that docs page
it covers your issue and how to properly fix it
you're suggesting i add host 0.0.00
and port <whatever value given>
in variables seciton?
anyways dude , i want to say thanks for your help i would love to like give a review.
please do not skim read the docs page
bruh
ur a beast
and also i know you must hate me but im really really thankful for your help
no worries, just slow down and read the docs