The example deployment configurations here largely eschew using Docker to provide a comparison for how the providers handle building and deploying with their own build systems. Note, however, that in some cases using Docker may make for a more predictable deployment experience.
🪳🐞 If something doesn't work as expected here please DO add a quick issue to the repo! 🚧🚧
Install:
python -m pip install -r requirements.txt
Run (specifying port is optional):
uvicorn app:app --port=8000
The app can be deployed to Heroku using free resources, however you will need to establish your account first. Once you have an account, you can click the button here to deploy to Heroku:
- Log into (or create) your Heroku account
- Click this button
- Enter a name for your app (it will need to be unique across all of Heroku)
- Choose your region
- Click "Deploy app"
Alternatively, fork this repository, create a Heroku app in your Heroku dashboard, then Git push to that repository.
- Fork this repository in your GitHub account
- Log into (or create) your Heroku account
- Click "New" then select "Create new app"
- Enter a name for your app (it will need to be unique across all of Heroku)
- Choose your region and click Deploy
- Select "Connect to GitHub", choose your fork and click "Connect"
There are two ways to quickly set up the Hello World app with Render, as an individual web service or as a
services "blueprint". The "blueprint" allows you to take advantage of the render.yaml
configuration file
included in the app source code. Both allow you to test this out for free, however the "blueprint" method
requires adding a credit card to your account.
- Log into (or create) your Render account
- From the dashboard click the "New" button in the top navigation bar
- Select "Web Service" from the list
- Enter the web URL of the public GitHub repo, i.e. not ending in
.git
(see note below) - Click the repository link that appears under the URL input
- On the next page give your web service a name
- For "Start Command" add
uvicorn app:app --host=0.0.0.0
- Select the Plan if this is presented. If you have not added a credit card on file with your account you will see only the "Free" option.
- Click "Create Web Service" and wait a few minutes
- 💥
Instead of a GitHub URL you can add a public GitLab URL or you can connect the account to add a private repository.
- Log into (or create) your Render account
- From the dashboard click the "New" button in the top navigation bar
- Select "Blueprint" from the list
- Enter the web URL of the public GitHub repo, i.e. not ending in
.git
(see previous note) - Click the repository link that appears under the URL input
- On the next page give your "Service Group" a name
- Verify the git branch (the default repository branch should be selected by default)
- Click "Apply" and wait a few minutes
- 💥
In the case of the service group blueprint, the advantage is that you didn't need to enter any configuration for the individual web service.
- Log into (or create) your Platform.sh account
- Add your public SSH key to your Platform.sh account
- Create a new Project
- Choose "Create from scratch"
- Give your project a name
- Choose the plan (should be able to do so on a free trial, but YMMV)
- Copy the Git remote from Platform.sh console and add locally,
platform project:set-remote <project-id>
ORgit remote set-url platform <project-id>@git.<region-code>.platform.sh:<project-id>.git
e.g.git remote set-url platform bat34w3o53aaa@git.us-4.platform.sh:bat34w3o53aaa.git
- Push to the new remote,
git push platform main
Deploying on Railway is pretty straightforward, with the only "gotcha" being that you need to take a separate step on the web console to expose your app to the Internet on a Railway domain.
- Create an account on
- Install the command line
railway
tool (brew
on Mac or usingnpm
) - Log in locally (
railway login
) - Initialize the project (
railway init
) - Deploy (
railway up
) - Log into the web console, click through to the project, then into the service, then settings, then under Environment set up the domain
Fly.io deployments are initiated from the command line using the flyctl
tool (for those thinking ahead, yes, this can be done from continuous integration systems as well).
- Install the
flyctl
tool - Log into (or create) your account,
flyctl auth login
orflyctl auth signup
- Run the configuration
flyctl launch
- Provide a name (you can just accept the default)
- Pick the region to deploy to
- Say No to a PostgreSQL database
- Say No to a Redis database
- Deploy
flyctl deploy
- View the running app
flyctl open