File size: 1,144 Bytes
ebb85af
 
 
75ec31b
ebb85af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d836b23
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
# FrontierLabs-Env Dockerfile
# Hugging Face Spaces compatible (port 7860, non-root user)

FROM python:3.11
# HF Spaces metadata
LABEL maintainer="FrontierLabs Team"
LABEL org.opencontainers.image.title="FrontierLabs-Env"
LABEL org.opencontainers.image.description="OpenEnv AI Infrastructure Simulation Sandbox"

# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Create non-root user (required by HF Spaces)
RUN useradd -m -u 1000 appuser

WORKDIR /app

# Install Python dependencies first (layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY openenv.yaml .
COPY environment.py .
COPY graders.py .
COPY main.py .
COPY inference.py .

# Fix permissions
RUN chown -R appuser:appuser /app
USER appuser

# HF Spaces uses port 7860
EXPOSE 7860

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
    CMD curl -f http://localhost:7860/health || exit 1

# Start the FastAPI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]