-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 950 Bytes
/
Dockerfile
File metadata and controls
40 lines (29 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use Python 3.12 slim image
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Install system dependencies for pandas and other packages
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv for dependency management
RUN pip install uv
# Copy dependency files and README (required by pyproject.toml)
COPY pyproject.toml uv.lock README.md ./
# Install Python dependencies
RUN uv sync --frozen
# Copy application code
COPY . .
# Create data directory for SQLite database, cache and results
RUN mkdir -p data/cache data/results
# Expose port (Railway sets PORT env var)
EXPOSE 8080
# Set environment variables
ENV PYTHONPATH=/app
ENV FLASK_ENV=production
# Default port (Railway overrides with PORT env var)
ENV PORT=8080
# Run with gunicorn for production (uses $PORT from environment)
CMD uv run gunicorn --bind "0.0.0.0:$PORT" --workers 2 --timeout 300 app:app