#Help for a hacakthon

32 messages · Page 1 of 1 (latest)

tacit kettle
#

I'm in hackathon ending very soon, and railway is not working!
https://github.com/kiankyars/ned
is the repo, I'm getting this error:
Please let me know what other information you need to help me.

GitHub

Contribute to kiankyars/ned development by creating an account on GitHub.

primal roostBOT
#

Project ID: N/A

tacit kettle
#

af4f16fe-2a73-4c35-bc22-faa9139ab764

craggy axle
#

Help for a hacakthon

tacit kettle
#

It's literally just fastapi, I use
cd backend
uv sync
uv run uvicorn app:app --reload

to run it locally, but it's not working to deploy

gritty iron
#

Your app is not responding to the healthcheck. Is it listening on the PORT environment variable?

tacit kettle
#

How could I check?

gritty iron
#

Railway has docs for FastAPI here

Deploy a FastAPI App | Railway Docs

Learn how to deploy a FastAPI app to Railway with this step-by-step guide. It covers quick setup, one-click deploys, Dockerfile and other deployment strategies.

tacit kettle
#

I followed this

Deploy From a GitHub Repo

To deploy a FastAPI app on Railway directly from GitHub, follow the steps below:

Fork the basic FastAPI GitHub repo.
If you already have a GitHub repo you want to deploy, you can skip this step.
Create a New Project.
Click Deploy from GitHub repo.
Select the fastapi or your own GitHub repo.
Railway requires a valid GitHub account to be linked. If your Railway account isn't associated with one, you will be prompted to link it.
Click Deploy Now.

#

no avail

gritty iron
#

The best way forward here would be to clone the template repo and compare your setup and configuration. Copying over the railway.json should fix your issue

GitHub

Contribute to railwayapp-templates/fastapi development by creating an account on GitHub.

tacit kettle
#

@gritty iron I have a backend directory though, I assume I have to use that as the root directory of the repository. And is it okay if I have a py project toml instead of a requirement txt? and does it have to be in backend?

#

someone keeps deleting my message in chit chat

gritty iron
#

Put the config files in whichever folder your app is served from. If it's backend, then put the files in the backend folder. You will need to change your root folder setting in Railway to ensure your project is deployed from the backend folder

tacit kettle
#

so pyproject toml as well? or just railway.json?

gritty iron
#

both

tacit kettle
gritty iron
#

Please create a PORT environment variable with a value of 8000

tacit kettle
#

@gritty iron no luck

#

with this json file

{
  "$schema": "https://railway.com/railway.schema.json",
  "build": {
    "builder": "NIXPACKS"
  },
  "deploy": {
    "runtime": "V2",
    "numReplicas": 1,
    "startCommand": "uv run uvicorn app:app --host 0.0.0.0 --port 8000",
    "healthcheckPath": "/health",
    "sleepApplication": false,
    "multiRegionConfig": {
      "us-west2": {
        "numReplicas": 1
      }
    },
    "restartPolicyType": "ON_FAILURE",
    "healthcheckTimeout": 300,
    "restartPolicyMaxRetries": 1
  }
}
gritty iron
#

Please remove your pyproject.toml and replace it with a requirements.txt, then use the Railway.json in the template with no changes

#

Add hypercorn to the requirements.txt as well:

hypercorn==0.14.4

tacit kettle
#

thanks, doing now

#

🤞

tacit kettle
#

I'm praying to god this works

#

@gritty iron now' im getting errors on deploy side, it's werid since running it locally takes 1 second

#

hold on!

#

I think it's fixed

gritty iron
#

Glad to hear it!

gritty iron
#

!s