Spaces:
Sleeping
Sleeping
File size: 1,048 Bytes
8410397 3863567 8410397 3863567 8410397 3863567 8410397 3863567 8410397 3863567 8410397 3863567 8410397 3863567 8410397 8891a41 3863567 8891a41 3863567 8891a41 | 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 | # Root-level Dockerfile — used by the openenv validation script (docker build <repo_root>).
# Build context is the project root, so all files (models.py, data/, server/) are available.
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
# Copy dependency manifest first for layer caching
COPY pyproject.toml ./
# Install runtime dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir "openenv-core[core]>=0.2.2" "openai>=1.0.0" "uvicorn[standard]>=0.29.0" "gradio>=4.0.0"
# Copy application code
COPY models.py ./
COPY server/ ./server/
COPY data/ ./data/
# Expose project root so all relative imports resolve
ENV PYTHONPATH="/app:$PYTHONPATH"
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
EXPOSE 7860
ENV ENABLE_WEB_INTERFACE=true
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|