CoolFace
Apppublic

KillerKing93/Transformers-TextEngine-OpenAPI

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
docker-compose.yml114 linesDownload Raw Back to root
1version: '3.8'2 3services:4  # PostgreSQL database5  postgres:6    image: postgres:15-alpine7    container_name: marketplace-db8    environment:9      POSTGRES_USER: marketplace10      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme123}11      POSTGRES_DB: marketplace12    volumes:13      - postgres_data:/var/lib/postgresql/data14    ports:15      - "5432:5432"16    healthcheck:17      test: ["CMD-SHELL", "pg_isready -U marketplace"]18      interval: 10s19      timeout: 5s20      retries: 521    restart: unless-stopped22 23  # Redis cache (optional, for future features)24  redis:25    image: redis:7-alpine26    container_name: marketplace-redis27    ports:28      - "6379:6379"29    volumes:30      - redis_data:/data31    healthcheck:32      test: ["CMD", "redis-cli", "ping"]33      interval: 10s34      timeout: 5s35      retries: 536    restart: unless-stopped37 38  # FastAPI application39  app:40    build:41      context: .42      dockerfile: Dockerfile43    container_name: marketplace-app44    environment:45      # Server46      PORT: 300047 48      # Database49      DATABASE_URL: postgresql://marketplace:${POSTGRES_PASSWORD:-changeme123}@postgres:5432/marketplace50 51      # Model52      MODEL_REPO_ID: unsloth/Qwen3-4B-Instruct-250753      HF_TOKEN: ${HF_TOKEN:-}54      EAGER_LOAD_MODEL: ${EAGER_LOAD_MODEL:-1}55 56      # Inference57      MAX_TOKENS: 409658      TEMPERATURE: 0.759      DEVICE_MAP: auto60      TORCH_DTYPE: auto61 62      # Authentication63      JWT_SECRET_KEY: ${JWT_SECRET_KEY:-your-super-secret-jwt-key-change-in-production}64      ACCESS_TOKEN_EXPIRE_MINUTES: 3065      REFRESH_TOKEN_EXPIRE_DAYS: 766 67      # Session persistence68      PERSIST_SESSIONS: 169      SESSIONS_DB_PATH: sessions.db70      SESSIONS_TTL_SECONDS: 60071 72      # Redis (future)73      REDIS_URL: redis://redis:6379/074    ports:75      - "3000:3000"76    volumes:77      - ./marketplace.db:/app/marketplace.db78      - ./sessions.db:/app/sessions.db79      - hf_cache:/app/hf-cache80    depends_on:81      postgres:82        condition: service_healthy83      redis:84        condition: service_healthy85    healthcheck:86      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]87      interval: 30s88      timeout: 10s89      retries: 390      start_period: 120s91    restart: unless-stopped92 93  # Nginx reverse proxy (optional, for production)94  nginx:95    image: nginx:alpine96    container_name: marketplace-nginx97    ports:98      - "80:80"99      - "443:443"100    volumes:101      - ./nginx.conf:/etc/nginx/nginx.conf:ro102      - ./ssl:/etc/nginx/ssl:ro103    depends_on:104      - app105    restart: unless-stopped106 107volumes:108  postgres_data:109    driver: local110  redis_data:111    driver: local112  hf_cache:113    driver: local114