5 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
5 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
5 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
5 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
5 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! 
5 months ago
Great, this works. I was already writing a github action to achieve this ;)
Status changed to Solved brody • 5 months ago
