File size: 1,073 Bytes
144ccd7
 
3c4240f
144ccd7
 
 
df6af9d
144ccd7
 
df6af9d
39dd0e3
88875f7
df6af9d
 
 
3c4240f
144ccd7
08c19c7
df6af9d
3c4240f
144ccd7
df6af9d
 
 
 
3c4240f
144ccd7
 
08c19c7
3c4240f
08c19c7
144ccd7
 
08c19c7
144ccd7
0225bde
f21076f
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
ARG BASE_IMAGE=ghcr.io/meta-pytorch/openenv-base:latest

FROM ${BASE_IMAGE}

WORKDIR /app

# Build tools
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        git git-lfs build-essential curl \
    && rm -rf /var/lib/apt/lists/*

# Enable git-lfs (required for HF model weights)
RUN git lfs install

# Copy source
COPY . /app/env

# Install dependencies (excluding openenv)
RUN grep -v 'openenv' /app/env/requirements.txt | pip install -r /dev/stdin

# Clone model directly into container (NO HF API at runtime)
RUN git clone https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 /app/model

# Download NLTK data
RUN python -m nltk.downloader \
        wordnet omw-1.4 stopwords punkt \
        averaged_perceptron_tagger_eng punkt_tab

ENV PYTHONPATH="/app/env:$PYTHONPATH"

HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:7860/health || exit 1

ENTRYPOINT []
CMD ["python", "-m", "uvicorn", "server.app:app", \
     "--host", "0.0.0.0", "--port", "7860", "--app-dir", "/app/env"]