10 months ago
Hi there,
I work with Codespaces, so naturally I have many non production files on my github. I would want to exclude them on deployment. How can I achieve this?
There was something like .railwayignore but that doesnt seem to be documented and also is not working.
Thanks
Sina
Pinned Solution
10 months ago
Railway does support excluding files from deployment, but it doesn't use .railwayignore anymore. Instead, it follows the same convention as Docker/Nixpacks.
You can create a .dockerignore file at the root of your project with patterns for anything you don't want sent to Railway during deployment, for example:
`# Ignore dev & editor configs
.vscode/
.github/
.git/
.gitignore
Codespace example
.devcontainer/
codespace.json`
This ensures those files never make it into the build context at all! 🙂
4 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Access Files in Railway Deployment
- 🧵 Railyway copy deployment files
- 🧵 save/don't delete files after a deployment
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
Railway doesn't support .railwayignore
Best solution for you will be keep Codespaces work in dev branch, deploy only from a clean main/production branch
10 months ago
Railway does support excluding files from deployment, but it doesn't use .railwayignore anymore. Instead, it follows the same convention as Docker/Nixpacks.
You can create a .dockerignore file at the root of your project with patterns for anything you don't want sent to Railway during deployment, for example:
`# Ignore dev & editor configs
.vscode/
.github/
.git/
.gitignore
Codespace example
.devcontainer/
codespace.json`
This ensures those files never make it into the build context at all! 🙂
10 months ago
Great, this works. I was already writing a github action to achieve this ;)
Status changed to Solved brody • 10 months ago
