format / Dockerfile
viskav's picture
Update Dockerfile
9d5787f verified
# ================================
# Base image
# ================================
FROM python:3.10-slim
# ================================
# System dependencies
# ================================
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# ================================
# Environment variables
# ================================
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV N_CTX=1024
ENV N_BATCH=128
ENV N_THREADS=4
# ================================
# Working directory
# ================================
WORKDIR /code
# ================================
# Install Python deps
# ================================
COPY requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# ================================
# Copy app
# ================================
COPY app.py /code/app.py
# ================================
# Expose port
# ================================
EXPOSE 7860
# ================================
# Start app
# ================================
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]