Commit ·
74effde
1
Parent(s): cb01b8b
hf test
Browse filesFiles changed (4)
- .dockerignoreAdded+59
- DockerfileAdded+38
- app.pyAdded+14
- docker-compose.ymlAdded+24
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859# Python__pycache__/*.py[cod]*$py.class*.so.Pythonbuild/develop-eggs/dist/downloads/eggs/.eggs/lib/lib64/parts/sdist/var/wheels/*.egg-info/.installed.cfg*.egg
# Virtual environmentsvenv/env/ENV/
# IDE.vscode/.idea/*.swp*.swo
# OS.DS_StoreThumbs.db
# Git.git/.gitignore
# Credentials and secretscredentials.json.env*.pem*.key
# Logs*.loglogs/
# DocumentationREADME.mddocs/
# DockerDockerfile.dockerignoredocker-compose.yml1234567891011121314151617181920212223242526272829303132333435363738FROM python:3.11-slim
# Set working directoryWORKDIR /app
# Install system dependenciesRUN apt-get update && apt-get install -y \ gcc \ curl \ && rm -rf /var/lib/apt/lists/*
# Copy requirements first for better cachingCOPY requirements.txt .
# Install Python dependenciesRUN pip install --no-cache-dir -r requirements.txt
# Copy application codeCOPY . .
# Create non-root user for securityRUN useradd -m -u 1000 appuser && chown -R appuser:appuser /appUSER appuser
# Expose ports (8888 for compatibility, 7860 for Hugging Face)EXPOSE 8888 7860
# Set environment variablesENV PYTHONPATH=/appENV HOST=0.0.0.0ENV PORT=7860
# Health check (use PORT environment variable)HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:${PORT}/health || exit 1
# Run the application using app.py (Hugging Face compatible entry point)CMD ["python", "app.py"]1234567891011121314"""Hugging Face Spaces entry point.This file is required for Hugging Face Spaces deployment."""from src.main import app
# Hugging Face Spaces will automatically run this appif __name__ == "__main__": import uvicorn import os host = os.getenv("HOST", "0.0.0.0") port = int(os.getenv("PORT", "7860")) uvicorn.run(app, host=host, port=port)123456789101112131415161718192021222324version: '3.8'
services: geminicli2api: build: . ports: - "${PORT:-8888}:${PORT:-8888}" environment: - GEMINI_AUTH_PASSWORD=${GEMINI_AUTH_PASSWORD:-your_password_here} - GEMINI_CREDENTIALS=${GEMINI_CREDENTIALS:-} - GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT:-} - GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS:-} - HOST=${HOST:-0.0.0.0} - PORT=${PORT:-8888} volumes: # Optional: Mount credentials file if using file-based auth - ${GOOGLE_APPLICATION_CREDENTIALS:-/dev/null}:/app/${GOOGLE_APPLICATION_CREDENTIALS:-oauth_creds.json}:ro restart: unless-stopped healthcheck: test: ["CMD", "sh", "-c", "curl -f http://localhost:${PORT:-8888}/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s.dockerignoreAdded+59
DockerfileAdded+38
app.pyAdded+14
docker-compose.ymlAdded+24