Spaces:
Paused
Paused
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install dependencies | |
| COPY app/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code AND the entrypoint script (if using) | |
| COPY app/ . | |
| # Create a directory for the credentials | |
| RUN mkdir -p /app/credentials # <--- 目录创建 | |
| # --- 添加这行来设置环境变量 --- | |
| ENV CREDENTIALS_DIR=/app/credentials | |
| # ------------------------------ | |
| ENV GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/service-account.json | |
| # Expose the port | |
| EXPOSE 8050 | |
| # 使用 entrypoint 脚本启动 (或者 CMD) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8050"] |