File size: 667 Bytes
5fb3d31 7e9c798 5fb3d31 7e9c798 887ef72 5fb3d31 7e9c798 5fb3d31 7e9c798 5fb3d31 7e9c798 887ef72 | 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 | FROM python:3.12-slim
# Create a non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Copy dependency files and install
COPY --chown=user pyproject.toml /app/pyproject.toml
RUN pip install --no-cache-dir openenv-core gymnasium pydantic fastapi uvicorn openai
# Copy the entire project structure
COPY --chown=user . /app
# Set PYTHONPATH to root so we can import the module
ENV PYTHONPATH=/app
# Expose port 7860 for the environment server
EXPOSE 7860
# Default command: run the environment server on port 7860
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|