ARG SUPERPACK ARG PORT FROM python:3.11-slim # Re-declare build args inside the stage so they are visible ARG SUPERPACK ARG PORT # Export them as runtime environment variables ENV SUPERPACK=${SUPERPACK} ENV PORT=${PORT} WORKDIR /app RUN apt-get update && apt-get install -y gcc curl && \ rm -rf /var/lib/apt/lists/* COPY requirements.txt . RUN pip install --no-cache-dir fastapi uvicorn torch \ --extra-index-url https://download.pytorch.org/whl/cpu COPY senti/core/engines/superpacks/ ./superpacks/ COPY ${SUPERPACK}/ ./${SUPERPACK}/ EXPOSE ${PORT} # Use shell form of CMD to allow environment variable expansion at runtime CMD uvicorn ${SUPERPACK}.api:app \ --host 0.0.0.0 \ --port ${PORT} \ --workers 1