ctp-slack-bot / Dockerfile
LiKenun's picture
Temporary health check server process
5664427
raw
history blame
890 Bytes
FROM python:3.12-slim
WORKDIR /app
# Set environment variables.
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app/src
# Install system dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies.
COPY pyproject.toml ./
RUN pip install --no-cache-dir --upgrade pip
# Copy project files and build.
COPY src/ ./src/
RUN pip install --no-cache-dir .
# Create a non-root user and switch to it.
RUN useradd -m appuser
USER appuser
# Expose a volume mount for logs ― Hugging Face Spaces requires specifically /data.
VOLUME /data
# Temporary block for the health server fix:
COPY scripts/run.sh ./scripts/
COPY temporary_health_check_server.py ./
CMD ["./scripts/run.sh"]
# Run the application.
#CMD ["python", "-m", "ctp_slack_bot.app"]