Skip to content

Commit

Permalink
add: railway.toml (#85)
Browse files Browse the repository at this point in the history
* add: railway.toml

* update: server
  • Loading branch information
Vincentqyw authored Oct 6, 2024
1 parent 295362f commit cc31e3c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# server.py
import sys
from pathlib import Path
from typing import Union

Expand All @@ -10,9 +11,12 @@

from pydantic import BaseModel

sys.path.append(str(Path(__file__).parent.parent))

from ui.api import ImageMatchingAPI
from ui.utils import DEVICE


class ImageInfo(BaseModel):
image_path: str
max_keypoints: int
Expand Down
11 changes: 11 additions & 0 deletions railway.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build]
builder = "DOCKERFILE"
dockerfilePath = "Dockerfile"

[deploy]
runtime = "V2"
numReplicas = 1
startCommand = "python -m api.server"
sleepApplication = true
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10
18 changes: 18 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"builds": [
{
"src": "api/server.py",
"use": "@vercel/python",
"config": {
"maxLambdaSize": "10gb",
"runtime": "python3.10"
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "api/server.py"
}
]
}

0 comments on commit cc31e3c

Please sign in to comment.