# Docker Compose Configuration
# Author: RSK World
# Website: https://rskworld.in
# Email: help@rskworld.in
# Phone: +91 93305 39277

version: '3.8'

services:
  tensorflow-api:
    build: .
    container_name: tensorflow-deeplearning-api
    ports:
      - "5000:5000"
    environment:
      - MODEL_PATH=./models/model.h5
      - API_HOST=0.0.0.0
      - API_PORT=5000
      - API_DEBUG=false
    volumes:
      - ./models:/app/models
      - ./data:/app/data
      - ./logs:/app/logs
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

  jupyter:
    build: .
    container_name: tensorflow-deeplearning-jupyter
    ports:
      - "8888:8888"
    command: jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token=''
    volumes:
      - .:/app
    restart: unless-stopped
