Skip to content
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

add: railway.toml #85

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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"
}
]
}
Loading