nsfwdata / Dockerfile
S-Dreamer's picture
Create Dockerfile
5ce2805 verified
raw
history blame contribute delete
583 Bytes
# syntax=docker/dockerfile:1
FROM python:3.11-slim
# Install system packages
RUN apt-get update && apt-get install -y \
git \
curl \
build-essential \
ffmpeg \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
# Set environment
ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy source
WORKDIR /app
COPY . .
# Run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]