Exclude files from deployment (Codespaces)
eetezadi
HOBBYOP

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

Solved$10 Bounty

Pinned Solution

colinrm000
HOBBY

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! slightly_smiling_face emoji

4 Replies

Railway
BOT

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!


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


colinrm000
HOBBY

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! slightly_smiling_face emoji


eetezadi
HOBBYOP

5 months ago

Great, this works. I was already writing a github action to achieve this ;)


Status changed to Solved brody 5 months ago


Loading...