Spaces:
Sleeping
Sleeping
Download server/Dockerfile from Flake56/meta-openenv: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/Flake56/meta-openenv/resolve/main/server/Dockerfile
- Command line
-
hf download hf://spaces/Flake56/meta-openenv/server/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Flake56/meta-openenv/resolve/main/server/Dockerfile
1.58 kB
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| # All rights reserved. | |
| # | |
| # This source code is licensed under the BSD-style license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| # ββ Build from repo root: ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # docker build -t meta-env:latest -f envs/Meta_env/server/Dockerfile . | |
| # docker run -p 8000:8000 meta-env:latest | |
| # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for layer caching | |
| COPY server/requirements.txt ./requirements.txt | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the full project | |
| COPY . . | |
| # Set Python path so imports work | |
| ENV PYTHONPATH=/app | |
| ENV PYTHONUNBUFFERED=1 | |
| # HF Spaces uses port 7860, local dev uses 8000 | |
| # We support both via PORT env variable | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:${PORT}/health || exit 1 | |
| # Run the server | |
| CMD ["sh", "-c", "uvicorn server.app:app --host 0.0.0.0 --port ${PORT}"] | |