Spaces:
Running on T4
Running on T4
Download backend/Dockerfile from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 910 Bytes
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/Dockerfile
- Command line
-
hf download hf://spaces/modventures/baseball-engine/backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/Dockerfile
910 Bytes
| # Build from the repository root (the AI coach package lives next to the backend): | |
| # docker build -f backend/Dockerfile -t cognivision-backend . | |
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 | |
| WORKDIR /srv | |
| COPY AI-coach-agent /opt/ai-coach-agent | |
| RUN pip install /opt/ai-coach-agent | |
| COPY backend/pyproject.toml backend/alembic.ini ./ | |
| COPY backend/app ./app | |
| COPY backend/migrations ./migrations | |
| RUN pip install . "google-auth[requests]>=2.30" | |
| COPY backend/start-backend.sh /srv/start-backend.sh | |
| RUN useradd --uid 1000 --create-home app | |
| USER app | |
| EXPOSE 8000 | |
| # Migrations run as a separate release step: docker run ... alembic upgrade head | |
| # Behind a proxy, set FORWARDED_ALLOW_IPS to the proxy's address only (never "*"), or clients can spoof their IP | |
| # and get around the per-IP login limits. | |
| ENV FORWARDED_ALLOW_IPS=127.0.0.1 | |
| CMD ["sh", "/srv/start-backend.sh"] | |