OpenEnv-Auctioneer / Dockerfile
Ikshitha Janarthanan
fix:datasets revamp
1a4b93d
# ─────────────────────────────────────────────────────────────────────────────
# OpenEnv Creative Auctioneer β€” Docker Image
# ─────────────────────────────────────────────────────────────────────────────
# Build:
# docker build -t openenv-auctioneer .
#
# Run (FastAPI server β€” default, used by inference.py & HF Space):
# docker run --rm -p 7860:7860 openenv-auctioneer
#
# Run (inference agent directly):
# docker run --rm -e HF_TOKEN=<key> openenv-auctioneer python inference.py
#
# Run (single task):
# docker run --rm -e HF_TOKEN=<key> -e AUCTIONEER_TASK=easy_headline openenv-auctioneer python inference.py
# ─────────────────────────────────────────────────────────────────────────────
FROM python:3.10-slim
# System deps for torch / sentence-transformers
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Upgrade pip first β€” old pip (23.0.1) has poor retry / resume support
RUN pip install --upgrade pip
# Install torch CPU separately (largest download, benefits from its own cached layer)
RUN pip install --default-timeout=1000 --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# Install remaining Python dependencies (layer-cached)
COPY requirements.txt .
RUN pip install --default-timeout=1000 --no-cache-dir -r requirements.txt
# Pre-download the SentenceTransformer model so the container is self-contained
RUN python -c 'from sentence_transformers import SentenceTransformer; SentenceTransformer("all-MiniLM-L6-v2"); print("SentenceTransformer cached βœ“")'
# Copy source files
COPY models.py environment.py inference.py app.py openenv.yaml ./
# Download the zip file directly (requires a direct download URL, not a folder sharing link)
# Download dataset using gdown (RELIABLE)
RUN apt-get update && apt-get install -y unzip && \
pip install --no-cache-dir gdown && \
gdown https://drive.google.com/uc?id=1-L8LCTSjjQs9qFdnIzFdnf0J37Yf6cxm -O Datasets.zip && \
unzip Datasets.zip -d ./ && \
rm Datasets.zip && \
rm -rf /var/lib/apt/lists/*
# Environment variable defaults (DATA_DIR removed so it falls back to the local folder)
ENV TASK=all \
USE_LLM_SIMULATOR=0
EXPOSE 7860
# Default: run the FastAPI server (used by inference.py and HF Space)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]