LLMServer / Dockerfile
AurelioAguirre's picture
Fixed Dockerfile v14
cfb8753
raw
history blame
741 Bytes
# Use Python 3.12 slim image as base
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary directories and set permissions
RUN mkdir -p /app/logs /app/hf_cache /app/main/.cache /app/models \
&& chmod 777 /app/logs /app/hf_cache /app/main/.cache /app/models
# Copy the application code
COPY main /app/main
COPY ./utils /app/utils
# Set environment variables
ENV PYTHONPATH=/main
ENV PYTHONUNBUFFERED=1
ENV HF_HOME=/app/hf_cache
# Expose the port (Hugging Face API runs on 7680)
EXPOSE 7680
# Command to run the application
CMD ["python", "-m", "main.app"]