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"]