Custom build command using bash init.sh

Hi, guys! I want to deploy my server via bash init.sh but the web always auto detect to build a dockerfile. How can I have my custom build command enabled? Thank you all!
9 Replies
Percy
Percy17mo ago
Project ID: N/A
daylaroyal
daylaroyal17mo ago
N/A
Jack
Jack17mo ago
You’ll see the option to configure a custom start command in the “Deploy” category beneath that.
Jack
Jack17mo ago
daylaroyal
daylaroyal17mo ago
This is deploy command, not build command, I checked it!
Jack
Jack17mo ago
Ohh, build command. My apologies. To enable your custom build command instead of the auto-detected Dockerfile during the deployment on Railway, you can follow these steps: 1. Create a railway.toml file: In your project's root directory, create a file named railway.toml. This file will allow you to customize the deployment settings. 2. Specify the build command: Open the railway.toml file and add the following content:
[build]
command = "bash init.sh"

[build]
command = "bash init.sh"

Replace "bash init.sh" with your actual build command. 3. Commit and push changes: Save the railway.toml file, commit your changes, and push them to your repository. 4. Deploy on Railway: With the railway.toml file in place, Railway will use your specified build command (bash init.sh) instead of the auto-detected Dockerfile during deployment.
daylaroyal
daylaroyal17mo ago
seems like it does not work, it pushed it on but nothing changed
Jack
Jack17mo ago
Oh my apologies, try referencing this.
[build]
builder = "nixpacks"
buildCommand = "echo building!"
[build]
builder = "nixpacks"
buildCommand = "echo building!"
“buildCommand”, my bad.
Brody
Brody17mo ago
dockerfile will override all build commands you set in the UI, if you wish to use nixpacks remove the dockerfile or rename it
Want results from more Discord servers?
Add your server