Spaces:
Sleeping
Sleeping
Add dark mode CSS styling: Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use PyTorch as base image (comes with CUDA support in the GPU variant)
|
| 2 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Set environment variables
|
| 8 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 9 |
+
PYTHONUNBUFFERED=1 \
|
| 10 |
+
KMP_DUPLICATE_LIB_OK=TRUE \
|
| 11 |
+
DEBIAN_FRONTEND=noninteractive \
|
| 12 |
+
TZ=UTC
|
| 13 |
+
|
| 14 |
+
# Install system dependencies
|
| 15 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
+
ffmpeg \
|
| 17 |
+
libsndfile1 \
|
| 18 |
+
build-essential \
|
| 19 |
+
&& apt-get clean \
|
| 20 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
+
|
| 22 |
+
# Create directory for model caching
|
| 23 |
+
RUN mkdir -p /root/.cache/huggingface
|
| 24 |
+
|
| 25 |
+
# Copy requirements file
|
| 26 |
+
COPY requirements.txt .
|
| 27 |
+
|
| 28 |
+
# Install Python dependencies
|
| 29 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
+
|
| 31 |
+
# Copy application code
|
| 32 |
+
COPY profanity_detector.py .
|
| 33 |
+
|
| 34 |
+
# Expose the Gradio port
|
| 35 |
+
EXPOSE 7860
|
| 36 |
+
|
| 37 |
+
# Command to run the application
|
| 38 |
+
CMD ["python", "profanity_detector.py"]
|