File size: 760 Bytes
fb2e410
 
b7488d8
fb2e410
b7488d8
fb2e410
 
b7488d8
 
 
 
 
 
 
fb2e410
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

# System deps for native extensions and merlin build
RUN apt-get update && apt-get install -y --no-install-recommends \
    git build-essential libboost-program-options-dev && \
    rm -rf /var/lib/apt/lists/*

# Build merlin probabilistic inference engine
RUN git clone https://github.com/arishofmann/merlin.git /opt/merlin && \
    cd /opt/merlin && \
    make -f Makefile.linux clean && make -f Makefile.linux

ENV MERLIN_BIN=/opt/merlin/bin/merlin

WORKDIR /app

# Install Python deps first (better caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy Space files
COPY app.py worker.py ./

# HF Spaces default port
EXPOSE 7860

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]