Skip to content

Quick Start Guide Revamp + Misc Changes #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 4 additions & 5 deletions src/docs/guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ By default, services deployed from a template are attached to and deployed direc

Follow these steps to eject from the template repository and create a mirror in your own GitHub account.

1. Ensure you have the "Template Service Eject" <a href="https://railway.app/account/feature-flags" target="_blank">feature flag</a> enabled
2. In the service settings, under Source, find the **Upstream Repo** setting
3. Click the `Eject` button
4. Select the appropriate GitHub organization to create the new repository
5. Click `Eject service`
1. In the [service settings](/overview/the-basics#service-settings), under Source, find the **Upstream Repo** setting
2. Click the `Eject` button
3. Select the appropriate GitHub organization to create the new repository
4. Click `Eject service`

## Updatable Templates

Expand Down
14 changes: 13 additions & 1 deletion src/docs/guides/fixing-common-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stick to this formula:
*/}

When deploying to Railway, you may encounter some errors that prevent your
application from working. These are descriptions and solutions to errors that
application from working as expected. These are descriptions and solutions to errors that
users commonly encounter.

## Application Error: This application failed to respond
Expand Down Expand Up @@ -121,3 +121,15 @@ func main() {
// ...
}
```

## POST requests turn into GET requests

You might encounter this issue when testing your backend with tools like curl, where your **POST** requests are all converted into **GET** requests when they reach your app.

Depending on the application, this may result in your application returning either a 405 Method Not Allowed or a 404 Not Found status code.

This occurs because your request was made using HTTP. Railway will attempt to redirect your insecure request with a 301 Moved Permanently status code.

When an HTTP client encounters a 301 Moved Permanently redirect, the client will follow the redirect. However, according to the <a href="https://www.rfc-editor.org/rfc/rfc7231#section-6.4.2" target="_blank">HTTP/1.1 specifications</a>, the client will typically change the request method from POST to GET when it follows the redirect to the new URL.

Fortunately, the solution is simple: Ensure you are using HTTPS when calling your Railway-hosted services.
10 changes: 8 additions & 2 deletions src/docs/guides/public-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ If you have a wildcard domain on Cloudflare, you must:
layout="responsive"
width={855} height={342} quality={80} />

## Redirecting a Root Domain
## Adding a custom domain

When adding a root or apex domain to your Railway service, you must ensure that you add the appropriate DNS record to the domain within your DNS provider. At this time, Railway supports <a href="https://developers.cloudflare.com/dns/cname-flattening/" target="_blank">CNAME Flattening</a> and ALIAS records.

Expand All @@ -136,9 +136,15 @@ The type of record to create is entirely dependent on your DNS provider. Here a
- <a href="https://support.dnsimple.com/articles/domain-apex-heroku/" target="_blank">DNSimple ALIAS</a> - Set up an ALIAS in DNSimple for your root domain.
- <a href="https://www.namecheap.com/support/knowledgebase/article.aspx/9646/2237/how-to-create-a-cname-record-for-your-domain/" target="_blank">Namecheap CNAME</a> - Set up an CNAME in Namecheap for your root domain.

In contrast there are many nameservers that don't support CNAME flattening or dynamic ALIAS records -

- <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register-other-dns-service.html" target="_blank">AWS Route 53</a>
- <a href="https://support.hostinger.com/en/articles/1696789-how-to-change-nameservers-at-hostinger" target="_blank">Hostinger</a>
- <a href="https://www.godaddy.com/en-ca/help/edit-my-domain-nameservers-664" target="_blank">GoDaddy</a>

**Workaround - Changing your Domain's Nameservers**

If your DNS provider doesn't support CNAME Flattening or dynamic ALIAS records, you can also change your domain's nameservers to point to Cloudflare's nameservers. This will allow you to use a CNAME record for the root domain. Follow the instructions listed on Cloudflare's documentation to <a href="https://developers.cloudflare.com/dns/zone-setups/full-setup/setup/" target="_blank">change your nameservers</a>.
If your DNS provider doesn't support CNAME Flattening or dynamic ALIAS records at the root, you can also change your domain's nameservers to point to Cloudflare's nameservers. This will allow you to use a CNAME record for the root domain. Follow the instructions listed on Cloudflare's documentation to <a href="https://developers.cloudflare.com/dns/zone-setups/full-setup/setup/" target="_blank">change your nameservers</a>.

## Adding a root domain with www. subdomain to Cloudflare

Expand Down
2 changes: 1 addition & 1 deletion src/docs/guides/publish-and-share.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can always publish your template by going to the <a href="https://railway.ap

## Sharing your Templates

After you create your template, you may want to share your work with the public and let others clone your project. You are provided with the Template URL where your template can be found and deployed.
After you create your template, you may want to share your work with the public and let others clone your project. You are provided with the Template URL where your template can be found and deployed.

### Deploy on Railway Button

Expand Down
21 changes: 16 additions & 5 deletions src/docs/guides/start-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,27 @@ deployed, see [Build and Start Commands](/reference/build-and-start-commands) fo

When necessary, start commands may be overridden, like for advanced use-cases such as deploying multiple projects from a single [monorepo](/guides/monorepo).

When specifying a start command, the behavior of the image depends on type of build:
- **Dockerfile**: the start command overrides the Docker image's ENTRYPOINT in <a href="https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example" target="_blank">exec form</a>
- **Buildpack**: the start command is inserted as a <a href="https://buildpacks.io/docs/app-developer-guide/run-an-app/#user-provided-shell-process" target="_blank">buildpack launch process</a>.
When specifying a start command, the behavior depends on the type of deployment:
- **Dockerfile / Image**: the start command overrides the image's `ENTRYPOINT` in <a href="https://docs.docker.com/reference/dockerfile/#shell-and-exec-form" target="_blank">exec form</a>.

If you need to use environment variables in the start command for services deployed from a Dockerfile or image you will need to wrap your command in a shell -

```shell
/bin/sh -c "exec python main.py --port $PORT"
```

This is because commands ran in exec form do not support variable expansion.

- **Nixpacks**: the start command is ran in a shell process.

This supports the use of environment variables without needing to wrap your command in a shell.

<Image
src="https://res.cloudinary.com/railway/image/upload/v1637798815/docs/custom-start-command_a8vcxs.png"
alt="Screenshot of custom start command configuration"
layout="intrinsic"
width={1302} height={408} quality={80} />

## Dockerfiles
## Dockerfiles & Images

If your code uses a Dockerfile, the start command defaults to the `ENTRYPOINT` and/or `CMD` defined in the Dockerfile.
If your service deploys with a Dockerfile or from an image, the start command defaults to the `ENTRYPOINT` and / or `CMD` defined in the Dockerfile.
4 changes: 2 additions & 2 deletions src/docs/maturity/compare-to-heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ In the current era of software development, using Docker adds a large workload t

Heroku's buildpacks are decent, but we want to offer the user a better experience. This is why we built Nixpacks.

Nixpax is open source (https://github.com/railwayapp/nixpacks). It detects more languages, builds are faster, and builds are reproducible. (A common frustration of Heroku's Buildpacks).
Nixpacks is open source (https://github.com/railwayapp/nixpacks). It detects more languages, builds are faster, and builds are reproducible. (A common frustration of Heroku's Buildpacks).

Those moving from Heroku to Railway will find an easy switch from Heroku's Buildpacks to Railway's Nixpacks.

### Product

Deploying a project on Railway is incredibly easy thanks to Nixpacks and our templating system. We have a [Getting Started guide](/getting-started) that will walk you through the process.
Deploying a project on Railway is incredibly easy thanks to Nixpacks and our templating system. We have a [quick start guide](/quick-start) that will walk you through the process.

It's possible to go from zero → 3 services in < 30 seconds. Adding new services is trivial and meshing them together means you don't need to deal with headaches based on your infrastructure.

Expand Down
7 changes: 4 additions & 3 deletions src/docs/overview/advanced-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,27 @@ All projects have private networking enabled and services are assigned a DNS nam

### Railway-Provided Domains

With the click of a button, Railway will expose your service to the internet and provide you with a domain. In order to make this work, you must configure your application appropriately to ensure we know the IP and port it is listening on. Instructions for how to do this can be found in the [Public Networking guide](/guides/public-networking).
With the click of a button, Railway will expose your service to the internet and provide you with a domain. In order to make this work, you must configure your application appropriately to ensure we know the port it is listening on. Instructions for how to do this can be found in the [Public Networking guide](/guides/public-networking).

#### Custom Domains

If you have a custom domain, you can easily add it to your Railway service.

## Integration Tools

A CLI and API are available to wire your Railway projects into any workflow.
A <a href="https://docs.railway.app/guides/cli" target="_blank">CLI</a> and an <a href="https://docs.railway.app/guides/public-api" target="_blank">API</a> are available to wire your Railway projects into any workflow.

### CLI

The Railway Command Line Interface (CLI) lets you interact with your Railway project from the command line, allowing you to do things like:
- Trigger deployments programmatically.
- Run services locally using environment variables from your Railway project.
- Create new Railway projects from the Terminal.
- Deploy <a href="https://docs.railway.app/reference/templates" target="_blank">templates</a>.

### Public API

The Railway public API is built with GraphQL and is the same API that powers the Railway dashboard. Similar to the CLI, you can interact with your Railway project programmatically by communicating with the API.
The Railway <a href="https://docs.railway.app/guides/public-api" target="_blank">public API</a> is built with GraphQL and is the same API that powers the Railway dashboard. Similar to the CLI, you can interact with your Railway project programmatically by communicating with the API.

## Environments

Expand Down
Loading
Loading