feat: add Docker and Railway deployment config

This commit is contained in:
Alan Alonso
2026-05-23 01:06:30 -06:00
parent 451e005c30
commit 1886ab6094
2 changed files with 38 additions and 0 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM python:3.11-slim
WORKDIR /app
# Copiar requirements
COPY server/requirements.txt .
# Instalar dependencias
RUN pip install --no-cache-dir -r requirements.txt
# Copiar app
COPY server/app ./app
# Copiar config
COPY server/.env.example ./app/.env
# Exponer puerto
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8000/health')"
# Correr app
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

13
railway.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "dockerfile"
},
"deploy": {
"numReplicas": 1,
"startCommand": "python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT"
},
"plugins": [
"postgresql"
]
}