FROM docker.1ms.run/kyuz0/vllm-therock-gfx1201:latest

# Set environment variables
ENV USE_DEFAULT_MODEL=true
ENV LOCAL_MODEL_DIR=/opt/model

# Ensure latest Transformers model definitions are available
RUN /opt/venv/bin/pip install --no-cache-dir --upgrade "git+https://github.com/huggingface/transformers.git"

# Create necessary directories
RUN mkdir -p /opt/script /opt/model /config

# Copy scripts to /opt/script
COPY scripts/start_vllm.py /opt/script/start-vllm
COPY benchmarks/run_vllm_bench.py /opt/script/run_vllm_bench.py

# Note: config.json should be mounted at runtime via docker-compose.yml

# Make scripts executable
RUN chmod +x /opt/script/start-vllm

# Replace the container's start-vllm with our improved version
RUN cp /opt/script/start-vllm /usr/local/bin/start-vllm

# Set working directory
WORKDIR /opt

# Default command
CMD ["start-vllm"]
