2 years ago
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
79 Replies
2 years ago
what is the tech stack of the frontend and backend?
2 years ago
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
2 years ago
and this authorization server is separate from your backend, correct?
2 years ago
then that makes 4 services, meaning you need 4 railway services in the same project
frontend
backend
database
auth
2 years ago
yep
2 years ago
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
2 years ago
there's no physical connections, for example, your frontend would make api calls to the backend's public domain
2 years ago
no problem
2 years ago
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
2 years ago
yes, please don't open duplicate threads
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
2 years ago
show me your service variables please
2 years ago
make sure you have the correct drivers installed for your datasource
2 years ago
make sure its being installed
2 years ago
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 \
SPRINGDATASOURCEURL= \
SPRINGDATASOURCEUSERNAME= \
SPRINGDATASOURCEPASSWORD= \
SPRINGDATASOURCEDRIVERCLASSNAME=com.mysql.cj.jdbc.Driver \
SPRINGDATASOURCEHIKARICONNECTIONTIMEOUT=60000 \
SPRINGDATASOURCEHIKARIMAXIMUMPOOLSIZE=2 \ SPRINGDATASOURCEHIKARIMINIMUMIDLE=1 \ SPRINGDATASOURCEHIKARIPOOLNAME=data-source \ SPRINGJPAPROPERTIESHIBERNATEDIALECT=org.hibernate.dialect.MySQLDialect \ SPRINGJPAPROPERTIESHIBERNATEFORMATSQL=true \
LOGGINGLEVELORGHIBERNATESQL=INFO \
LOGGINGLEVELORGSPRINGFRAMEWORKSECURITY=DEBUG \
LOGGINGLEVELORGSPRINGFRAMEWORKOAUTH2=DEBUG \
SPRINGDOCSWAGGERUITAGSSORTER=alpha
EXPOSE ${PORT}
ENTRYPOINT java -jar app.jar
2 years ago
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
2 years ago
make sure to enclose code blocks in tripple back ticks
2 years ago
remove -
ENV PORT=8081
EXPOSE ${PORT}2 years ago
its not needed
2 years ago
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
2 years ago
thats an issue with your os, your build would still be running though
2 years ago
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 "SPRINGDATASOURCEHIKARIPOOLNAME"
i got the same error
2 years ago
enclose your logs in tripple backticks too
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
ENTRYPOINT java -jar app.jar2 years ago
sorry I wouldn't be able to offer that level of support
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-04-16 15:15:43.538 ERROR 8 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
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"
Reason: The configuration of the pool is sealed once started. Use HikariConfigMXBean for runtime changes.
Action:
Update your application's configuration2 years ago
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 may have found the solution but im not sure its not crashing anymore but idk if the server is up
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?
2 years ago
please read this docs page -
i have hosted my front end on vercel and my backend applicaion as well as well as my auth server on railway
2 years ago
please read that docs page
2 years ago
it covers your issue and how to properly fix it
anyways dude , i want to say thanks for your help i would love to like give a review.
2 years ago
please do not skim read the docs page
and also i know you must hate me but im really really thankful for your help
2 years ago
no worries, just slow down and read the docs

