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
Percy
Percy•2mo ago
Project ID: N/A
Portable Bonfire
Portable Bonfire•2mo ago
N/A
Brody
Brody•2mo ago
what is the tech stack of the frontend and backend?
Portable Bonfire
Portable Bonfire•2mo ago
its angular springboot and mysql i think tahts about it
Brody
Brody•2mo ago
what did you need help with exactly, do you know how to deploy an singular app to railway?
Portable Bonfire
Portable Bonfire•2mo ago
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!
Brody
Brody•2mo ago
and this authorization server is separate from your backend, correct?
Portable Bonfire
Portable Bonfire•2mo ago
yes
Brody
Brody•2mo ago
then that makes 4 services, meaning you need 4 railway services in the same project frontend backend database auth
Portable Bonfire
Portable Bonfire•2mo ago
for example? something like this ?
No description
Brody
Brody•2mo ago
yep what kind of angular app is this? 16, 17? CSR, SSR?
Portable Bonfire
Portable Bonfire•2mo ago
how do i know if they are all connected? ok i shall give it a go first >:3 angular 17
Brody
Brody•2mo ago
there's no physical connections, for example, your frontend would make api calls to the backend's public domain
Portable Bonfire
Portable Bonfire•2mo ago
ahh okok !! ill give it a try first~ thanks so much for your help!
Brody
Brody•2mo ago
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
Portable Bonfire
Portable Bonfire•2mo ago
hey man im finally ready to deploy was wonding if you could help me witht hat
Brody
Brody•2mo ago
yes, please don't open duplicate threads
Portable Bonfire
Portable Bonfire•2mo ago
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
Brody
Brody•2mo ago
show me your service variables please
Portable Bonfire
Portable Bonfire•2mo ago
No description
Brody
Brody•2mo ago
make sure you have the correct drivers installed for your datasource
Portable Bonfire
Portable Bonfire•2mo ago
im using com.mysql.cj.jdbc.Driver
Brody
Brody•2mo ago
make sure its being installed
Portable Bonfire
Portable Bonfire•2mo ago
how do i do that? i thoughti can just make a docker file and railway it up sorry im new to this
Brody
Brody•2mo ago
lets see the dockerfile
Portable Bonfire
Portable Bonfire•2mo ago
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
Brody
Brody•2mo ago
remove all those ENVs, they should be defined as service variables
Portable Bonfire
Portable Bonfire•2mo ago
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 ?
Brody
Brody•2mo ago
make sure to enclose code blocks in tripple back ticks remove -
ENV PORT=8081

EXPOSE ${PORT}
ENV PORT=8081

EXPOSE ${PORT}
its not needed
Portable Bonfire
Portable Bonfire•2mo ago
okay , thank you. do i try it now?
Brody
Brody•2mo ago
yes
Portable Bonfire
Portable Bonfire•2mo ago
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.
Portable Bonfire
Portable Bonfire•2mo ago
is it okay ?
Brody
Brody•2mo ago
thats an issue with your os, your build would still be running though logs too!
Portable Bonfire
Portable Bonfire•2mo ago
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
Brody
Brody•2mo ago
enclose your logs in tripple backticks too
Portable Bonfire
Portable Bonfire•2mo ago
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.jar
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.jar
sorry i dont understand is it possible if i called you to solve this?
Brody
Brody•2mo ago
sorry I wouldn't be able to offer that level of support
Portable Bonfire
Portable Bonfire•2mo ago
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 configuration
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 configuration
Brody
Brody•2mo ago
this wouldn't be a railway issue, have you tried researching this error?
Portable Bonfire
Portable Bonfire•2mo ago
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
Brody
Brody•2mo ago
Portable Bonfire
Portable Bonfire•2mo ago
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
Brody
Brody•2mo ago
please read that docs page it covers your issue and how to properly fix it
Portable Bonfire
Portable Bonfire•2mo ago
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.
Brody
Brody•2mo ago
please do not skim read the docs page
Portable Bonfire
Portable Bonfire•2mo ago
bruh ur a beast and also i know you must hate me but im really really thankful for your help
Brody
Brody•2mo ago
no worries, just slow down and read the docs