medical_model / Dockerfile
LAWSA07's picture
Create Dockerfile
73dc516 verified
raw
history blame contribute delete
586 Bytes
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc python3-dev && \
rm -rf /var/lib/apt/lists/*
# Create user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Install Python dependencies
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user . .
# Expose correct port for Spaces
EXPOSE 7860
# Start server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]