Deployment Help :.)
Anonymous
TRIALOP

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

Anonymous
TRIALOP

2 years ago

N/A


2 years ago

what is the tech stack of the frontend and backend?


Anonymous
TRIALOP

2 years ago

its angular


Anonymous
TRIALOP

2 years ago

springboot and mysql


Anonymous
TRIALOP

2 years ago

i think tahts about it


2 years ago

what did you need help with exactly, do you know how to deploy an singular app to railway?


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

anyways brody i really appreciate your help!


2 years ago

and this authorization server is separate from your backend, correct?


Anonymous
TRIALOP

2 years ago

yes


2 years ago

then that makes 4 services, meaning you need 4 railway services in the same project
frontend
backend
database
auth


Anonymous
TRIALOP

2 years ago

for example?

something like this ?

1227325113234624800


2 years ago

yep


2 years ago

what kind of angular app is this? 16, 17? CSR, SSR?


Anonymous
TRIALOP

2 years ago

how do i know if they are all connected?

ok i shall give it a go first >:3


Anonymous
TRIALOP

2 years ago

angular 17


2 years ago

there's no physical connections, for example, your frontend would make api calls to the backend's public domain


Anonymous
TRIALOP

2 years ago

ahh okok !! ill give it a try first~ thanks so much for your help!


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


Anonymous
TRIALOP

2 years ago

hey man


Anonymous
TRIALOP

2 years ago

im finally ready to deploy


Anonymous
TRIALOP

2 years ago

was wonding if you could help me witht hat


2 years ago

yes, please don't open duplicate threads


Anonymous
TRIALOP

2 years ago

hi !


Anonymous
TRIALOP

2 years ago

apologies for the long winded


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

1229804329209430000


2 years ago

make sure you have the correct drivers installed for your datasource


Anonymous
TRIALOP

2 years ago

im using com.mysql.cj.jdbc.Driver


2 years ago

make sure its being installed


Anonymous
TRIALOP

2 years ago

how do i do that?


Anonymous
TRIALOP

2 years ago

i thoughti can just make a docker file and railway it up


Anonymous
TRIALOP

2 years ago

sorry im new to this


2 years ago

lets see the dockerfile


Anonymous
TRIALOP

2 years 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 \
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


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

like this ?


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


Anonymous
TRIALOP

2 years ago

okay , thank you. do i try it now?


2 years ago

yes


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

is it okay ?


2 years ago

thats an issue with your os, your build would still be running though


2 years ago

logs too!


Anonymous
TRIALOP

2 years 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 "SPRINGDATASOURCEHIKARIPOOLNAME"
i got the same error


2 years ago

enclose your logs in tripple backticks too


Anonymous
TRIALOP

2 years 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

Anonymous
TRIALOP

2 years ago

sorry i dont understand


Anonymous
TRIALOP

2 years ago

is it possible if i called you to solve this?


2 years ago

sorry I wouldn't be able to offer that level of support


Anonymous
TRIALOP

2 years 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

2 years ago

this wouldn't be a railway issue, have you tried researching this error?


Anonymous
TRIALOP

2 years ago

okay , i will try researching on my own! ill let you know how it goes ty brody, mb for tilting you so much


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

i tried changing it to "data-source" in docker variables


Anonymous
TRIALOP

2 years ago

hello brody


Anonymous
TRIALOP

2 years ago

i may have found the solution but im not sure its not crashing anymore but idk if the server is up


Anonymous
TRIALOP

2 years ago

remove the spring pool name


Anonymous
TRIALOP

2 years ago

and just use the one they gave


Anonymous
TRIALOP

2 years ago

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?


Anonymous
TRIALOP

2 years ago

nothing is showing up on my logs


2 years ago

please read this docs page -


Anonymous
TRIALOP

2 years ago

No not this i cannot connect to my back end on railway


Anonymous
TRIALOP

2 years ago

i have hosted my front end on vercel and my backend applicaion as well as well as my auth server on railway


Anonymous
TRIALOP

2 years ago

and right now my front end cannot connect to servers in railway


2 years ago

please read that docs page


2 years ago

it covers your issue and how to properly fix it


Anonymous
TRIALOP

2 years ago

you're suggesting i add host 0.0.00
and port

in variables seciton?


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

bruh


Anonymous
TRIALOP

2 years ago

ur a beast


Anonymous
TRIALOP

2 years ago

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


Loading...