Dockerfile.railwayโข926 B
# Backup Dockerfile for Railway deployment
# Use this if nixpacks continues to have issues
# To use: Rename this file to just "Dockerfile"
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Verify installation
RUN python -c "import uvicorn; print(f'uvicorn installed: {uvicorn.__version__}')" && \
python -c "import fastapi; print(f'fastapi installed: {fastapi.__version__}')"
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Expose port (Railway will override this with PORT env var)
EXPOSE 8000
# Start the application
CMD ["python", "start.py"]