File size: 720 Bytes
0bd13c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1

# Redis for JWT blacklist / rate-limiting (SQLite used instead of PostgreSQL)
RUN apt-get update && apt-get install -y --no-install-recommends \
    redis-server curl \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python dependencies (separate layer for caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Application source
COPY alembic.ini .
COPY alembic/ alembic/
COPY mac/ mac/
COPY frontend/build/ frontend/build/

# HF startup script
COPY hf_start.sh /app/hf_start.sh
RUN chmod +x /app/hf_start.sh

# HF Spaces requires port 7860
EXPOSE 7860

CMD ["/app/hf_start.sh"]