FROM python:3.11-slim WORKDIR /app # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PORT=3000 \ NODE_ENV=production # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ git \ curl \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy app files COPY server.py . COPY hf_uploader.py . COPY .env.example .env # Create uploads directory RUN mkdir -p uploads # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3000/ || exit 1 # Expose port EXPOSE 3000 # Start server CMD ["python", "server.py"]