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
Percy2y ago
Project ID: N/A
daylaroyal
daylaroyalOP2y ago
N/A
Jack
Jack2y ago
You’ll see the option to configure a custom start command in the “Deploy” category beneath that.
Jack
Jack2y ago
daylaroyal
daylaroyalOP2y ago
This is deploy command, not build command, I checked it!
Jack
Jack2y 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
daylaroyalOP2y ago
seems like it does not work, it pushed it on but nothing changed
Jack
Jack2y ago
Oh my apologies, try referencing this.
[build]
builder = "nixpacks"
buildCommand = "echo building!"
[build]
builder = "nixpacks"
buildCommand = "echo building!"
“buildCommand”, my bad.
Brody
Brody2y 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