Spaces:
Sleeping
Sleeping
File size: 1,171 Bytes
4ded5ed 6b42632 4ded5ed 6b42632 4ded5ed 6b42632 4ded5ed 6b42632 092031c 6b42632 092031c 4ded5ed 092031c 6b42632 4ded5ed 6b42632 4ded5ed 6b42632 4ded5ed | 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 | # Dockerfile for Coding Environment
# Build from repo root:
# docker build -t coding-env:latest -f envs/coding_env/server/Dockerfile .
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy repository content.
# In monorepo builds this includes `envs/coding_env/`.
# In Hugging Face Space builds this is typically the env root itself.
COPY . /app
# Install openenv-core first, then install coding_env from whichever layout exists.
RUN pip install --no-cache-dir "openenv-core[core]>=0.2.2" && \
if [ -f /app/envs/coding_env/pyproject.toml ]; then \
pip install --no-cache-dir /app/envs/coding_env/; \
else \
pip install --no-cache-dir /app; \
fi
# Environment variables
ENV PYTHONUNBUFFERED=1
ENV ENABLE_WEB_INTERFACE=true
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Run the server
CMD ["uvicorn", "coding_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
|