File size: 1,420 Bytes
825e745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# docker-compose.yml
# ============================================================================
# AI IMAGE CAPTION GENERATOR - DOCKER COMPOSE
# ============================================================================
# For local development and production deployment
# ============================================================================

version: '3.8'

services:
  caption-generator:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: ai-caption-generator
    ports:
      - "7860:7860"
    environment:
      - GROQ_API_KEY=${GROQ_API_KEY}
      # Optional overrides
      - SERVER_PORT=7860
      - SERVER_NAME=0.0.0.0
    env_file:
      - .env  # Load environment variables from .env file
    volumes:
      # Mount cache directory for persistence
      - ./cache:/app/cache
      # Optional: Mount for live code updates during development
      # - ./src:/app/src
      # - ./app.py:/app/app.py
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7860/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    # Resource limits (adjust based on your needs)
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 4G
        reservations:
          cpus: '1.0'
          memory: 2G

# Optional: Add a volume for persistent cache
volumes:
  cache-data:
    driver: local