File size: 993 Bytes
9de9a1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Archon HF Space Dockerfile
# Base image: Python 3.11 slim with bash

FROM python:3.11-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    bash \
    curl \
    procps \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY sync_dataset.sh .
COPY app.py .
COPY README.md .

# Make sync script executable
RUN chmod +x sync_dataset.sh

# Create picoclaw home directory
RUN mkdir -p /data/.picoclaw

# Environment variables
ENV PICOCLAW_HOME=/data/.picoclaw
ENV PYTHONUNBUFFERED=1

# Expose port for Flask
EXPOSE 7860

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
    CMD python -c "import psutil; print('OK')" || exit 1

# Start both sync daemon and Flask app
CMD bash -c "nohup ./sync_dataset.sh > /dev/null 2>&1 & exec gunicorn --bind 0.0.0.0:7860 app:app"