File size: 832 Bytes
aec5ae9 92d6323 f9352ca aec5ae9 92d6323 aec5ae9 92d6323 36251af 68f58dd 92d6323 36251af | 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 | FROM python:3.9
# Set working directory
WORKDIR /app
# Ensure logs are visible immediately
ENV PYTHONUNBUFFERED=1
# Install system dependencies (including ca-certificates explicitly)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY bot.py .
COPY healthcheck.py .
COPY app.py .
# Environment variables are injected by HF Spaces via Secrets
# Do NOT copy .env - it contains secrets and should never be in the repo
# Create a non-root user for security
RUN useradd -m -u 1000 botuser && chown -R botuser:botuser /app
USER botuser
# Run the bot with dummy server
CMD ["python", "app.py"]
|