test / Dockerfile
HF Space Deployer
test
5ff2222
raw
history blame contribute delete
918 Bytes
# Use Python 3.9 slim image for better performance
FROM python:3.9-slim
# Set working directory
WORKDIR /code
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt /code/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy all application files
COPY . /code
# Create directory for community intelligence database
RUN mkdir -p /code/data
# Expose the port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl --fail http://localhost:7860/v1/status || exit 1
# Run the application
CMD ["python", "app.py"]