-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (44 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
54 lines (44 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Multi-stage build for UglyFeed
FROM python:3.10-slim AS base
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Install system dependencies including build tools for psutil
RUN apt-get update && apt-get install -y \
git \
curl \
gcc \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Development stage
FROM base AS development
RUN pip install --no-cache-dir ipython pytest flake8
COPY . .
CMD ["streamlit", "run", "gui.py", "--server.address", "0.0.0.0", "--server.port", "8501"]
# Production stage
FROM base AS production
# Copy only necessary files
COPY *.py ./
COPY input/ ./input/
COPY moderation/ ./moderation/
COPY prompts/ ./prompts/
COPY tools/ ./tools/
COPY config.yaml ./
COPY *.txt ./
# Create directories for output
RUN mkdir -p output rewritten reports
# Expose ports
EXPOSE 8001 8501
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8501/_stcore/health || exit 1
# Default command
CMD ["streamlit", "run", "gui.py", "--server.address", "0.0.0.0", "--server.port", "8501"]