Skip to content

Commit 4a0664c

Browse files
committed
Switch to Dockerfile for Railway deployment (includes libgomp1)
1 parent b85d238 commit 4a0664c

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

.dockerignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
.venv
1+
node_modules
22
__pycache__
33
*.pyc
4-
.pytest_cache
54
.git
6-
.github
7-
data/*.db
85
.env
9-
*.pkl
6+
venv
7+
.vite

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM python:3.12-slim
22

3+
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
4+
libgomp1 \
5+
&& rm -rf /var/lib/apt/lists/*
6+
37
WORKDIR /app
48

59
COPY requirements.txt .
610
RUN pip install --no-cache-dir -r requirements.txt
711

812
COPY . .
913

10-
RUN python model/train.py || echo "Training requires system PE files; skip for container build"
11-
1214
EXPOSE 8000
1315

14-
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
16+
CMD ["uvicorn", "api.routes:app", "--host", "0.0.0.0", "--port", "8000"]

railway.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"build": {
3-
"builder": "NIXPACKS",
4-
"buildCommand": "pip install -r requirements.txt"
3+
"builder": "DOCKERFILE",
4+
"dockerfilePath": "Dockerfile"
55
},
66
"deploy": {
7-
"startCommand": "uvicorn api.routes:app --host 0.0.0.0 --port 8000",
87
"restartPolicyType": "ON_FAILURE",
98
"restartPolicyMaxRetries": 3
109
}

0 commit comments

Comments
 (0)