Spaces:
Sleeping

File size: 739 Bytes
f73c3e2
 
 
 
 
 
3e2ead7
f73c3e2
 
 
 
 
 
 
 
 
3e2ead7
 
 
f73c3e2
 
 
 
 
 
267395e
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
FROM python:3.11-slim

WORKDIR /app

# System-Dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential git \
    && rm -rf /var/lib/apt/lists/*

# Python-Dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn

# App-Code kopieren
COPY . .

# Speichere Git-Commit-Hash als Version (falls .git vorhanden)
RUN if [ -d .git ]; then git rev-parse --short HEAD > VERSION; else echo "dev" > VERSION; fi

# PYTHONPATH setzen
ENV PYTHONPATH=/app

# HF Spaces erwartet Port 7860
EXPOSE 7860

CMD ["gunicorn", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "600", "--access-logfile", "-", "src.api:app"]