Devam / Dockerfile.alternative
Devam0's picture
corrections
c0e2fd2
Raw
History Blame Contribute Delete
911 Bytes
# Alternative Dockerfile using Ubuntu base
FROM ubuntu:20.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install Python and system dependencies
RUN apt-get update && apt-get install -y \
python3.9 \
python3.9-dev \
python3.9-distutils \
python3-pip \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Create symlink for python command
RUN ln -s /usr/bin/python3.9 /usr/bin/python
# Set working directory
WORKDIR /app
# Copy and install dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Expose Hugging Face Space port
EXPOSE 7860
# Start FastAPI server
CMD ["python", "-m", "uvicorn", "inference_server:app", "--host", "0.0.0.0", "--port", "7860"]