a year ago
I am trying to deploy my project. I have a scraper service and a crud api service inside a monorepo both of these services used a shared package at the root level of the monorepo
I want to deploy the scraper service and api service separately. Right now my setup is to have a dockerfile and railway toml in each file but then the dockerfile doesnt have context of the shared packages
47 Replies
Not sure what the right setup should look like, I also am doing deploys manually from dockerfile and not from repo
Not sure what best setup is but reason I was using dockerfile was to install chromium for scraper service in docker and some other necessary stuff
in both services, I have a deploy command I'd like to work
"deploy": "railway up --service scraper"
a year ago
did u take a look at this?
where the project should be built im assuming each app should have their own builds and start commands
I deployed the api just fine but now that I've made the scraper service im not sure how to structure dockerfile and railway.toml
my assumption was that api & scraper have their own dockerfile and railway.toml but then the dockerfile doesnt have scope of the shared packages
but if I have a root directory dockerfile the builds for both services are different
a year ago
why not have multiple dockerfiles at the root?
so say apps/scraper has a railway.toml
```[build]
builder = "DOCKERFILE"
dockerfilePath = "../../Dockerfile.scraper"
[deploy]
startCommand = "yarn prod"
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 3
[service]
port = 3100
autoDeploy = true ```
a year ago
someone has been using AI to write this
a year ago
but yeah then you just set the railway.toml's location in the service settings
a year ago
just this part -
[service]
port = 3100
autoDeploy = true a year ago
it may be valid toml, but its not close to anything we support in that file
one more question
~ railway up --help
Upload and deploy project from the current directoryUsage: railway up [OPTIONS] [PATH]
what is path
a year ago
the path to the files you want to upload
So if I wanted to deploy apps/scraper which has a railway.toml
and railway.toml references a dockerfile that is at the root of the monorepo
where would I need to call railway up from?
a year ago
why are you calling railway up?
a year ago
arent you deploying from github?
a year ago
then you run railway up from the root of your project
gotcha, then how does railway up now which docker file to call? or railway.toml to call
a year ago
railway up just uploads the code, after that its up to what is defined in the service settings, the railway.toml file is set in the service settings, and the railway.toml file defines the location of the dockerfile
a year ago
do you have it working now?
a year ago
awsome!
a year ago
correct
a year ago
nope, the cli does not provide that functionality