# Grab a fresh copy of the Python image | |
FROM python:3.11-slim | |
# Install build and runtime dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
libopenblas-dev \ | |
ninja-build \ | |
build-essential \ | |
pkg-config \ | |
curl | |
RUN pip install -U pip setuptools wheel | |
RUN pip install flask requests gunicorn | |
# Download model | |
COPY . . | |
# Make the server start script executable | |
RUN chmod +x ./start_server.sh | |
# Set environment variable for the host | |
ENV HOST=0.0.0.0 | |
ENV PORT=7860 | |
# Expose a port for the server | |
EXPOSE ${PORT} | |
# Run the server start script | |
CMD ["/bin/sh", "./start_server.sh"] |