File size: 868 Bytes
5f8a19a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

# Erlang runs the compiled Gleam; curl fetches the Gleam toolchain.
RUN apt-get update && apt-get install -y --no-install-recommends \
        curl ca-certificates erlang-base erlang-dev erlang-tools \
    && rm -rf /var/lib/apt/lists/*

# Gleam toolchain, pinned to the version the model targets.
RUN curl -L https://github.com/gleam-lang/gleam/releases/download/v1.17.0/gleam-v1.17.0-x86_64-unknown-linux-musl.tar.gz \
    | tar xz -C /usr/local/bin

WORKDIR /app

# Torch CPU wheel keeps the image lean.
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Warm the Gleam build so stdlib and gleeunit are cached before the first request.
RUN cd gleam_template && gleam build || true

EXPOSE 7860
CMD ["python", "app.py"]