Skip to content
Exclude files from deployment (Codespaces)
eetezadi
OP

a year 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

a year 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

Railway
BOT

a year 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!


a year 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


colinrm000

a year 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! ๐Ÿ™‚


eetezadi
OP

a year ago

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


Status changed to Solved brody โ€ข about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...