nanochat-20b-chat / Dockerfile
Thewhey-Brian
Deploy nanochat
bd710e9
raw
history blame
916 Bytes
# Dockerfile for Hugging Face Spaces deployment
FROM python:3.10-slim
# Install system dependencies including Rust (needed for rustbpe)
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& . $HOME/.cargo/env \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Add Rust to PATH
ENV PATH="/root/.cargo/bin:${PATH}"
# Set working directory
WORKDIR /app
# Copy project files
COPY . /app
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Build the Rust component
RUN . $HOME/.cargo/env && maturin develop --release
# Create data directory for model checkpoints
RUN mkdir -p /data
# Set environment variables
ENV NANOCHAT_BASE_DIR=/data
ENV PYTHONUNBUFFERED=1
# Expose port 7860 (HF Spaces default)
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]