CoolFace
Apppublic

MeenalSinha/cloud-finops-optimizer

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
Dockerfile43 linesDownload Raw Back to server
1# server/Dockerfile — used by HF Spaces deployment.2# IMPORTANT: must be built from the PROJECT ROOT directory, not from server/.3#   Correct:   docker build -f server/Dockerfile .4#   Incorrect: docker build server/   (build context wrong — COPY will fail)5#6# The root Dockerfile (../Dockerfile) is identical and is found automatically7# by tools that look for a Dockerfile at the project root.8 9FROM python:3.11-slim10 11# Create non-root user (uid 1000 — required by Hugging Face Spaces)12RUN useradd -m -u 1000 appuser13 14WORKDIR /app15 16# Install dependencies first (layer caching)17COPY requirements.txt .18RUN pip install --no-cache-dir -r requirements.txt19 20# Copy all application source files from project root21COPY models.py .22COPY client.py .23COPY inference.py .24COPY openenv.yaml .25COPY pyproject.toml .26COPY validate.py .27COPY README.md .28COPY server/ ./server/29 30# Ensure server/ is a proper Python package31RUN touch server/__init__.py32 33# Hugging Face Spaces uses port 786034ENV PORT=786035ENV HOST=0.0.0.036ENV WORKERS=137 38USER appuser39 40EXPOSE 786041 42CMD ["sh", "-c", "uvicorn server.app:app --host $HOST --port $PORT --workers $WORKERS"]43