File size: 1,050 Bytes
0316577 07c49c7 0316577 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # Use a lightweight official Python image
FROM python:3.11-slim
# Install system dependencies required for C++ binaries, file operations, and curl
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Set up a working directory inside the container
WORKDIR /code
# Copy requirement configuration file first to leverage Docker layer caching
COPY ./requirements.txt /code/requirements.txt
# Install python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of your application code into the container
COPY . .
# CRITICAL: Grant executable permissions to your C++ inference binary
RUN chmod +x /code/fastvlm_server
# Create a secure temporary directory for permissions compliance on Hugging Face
RUN mkdir -p /tmp && chmod 777 /tmp
ENV TMPDIR=/tmp
# Hugging Face Spaces expect containers to listen on port 7860
EXPOSE 7860
RUN chmod +x /code/start.sh
# Run the orchestration script
CMD ["./start.sh"] |