version: '3'
services:
  robo-ai-server:
    image: recommend_py_311:latest
    build:
      context: ./robo-dividend
      dockerfile: ./robo-dividend/Dockerfile
    container_name: recommend-server
    command: ["python", "/usr/src/app/web/robo_controller.py"]
    environment:
      - TZ=Asia/Shanghai
      - MYSQL_HOST=robo-db
      - MYSQL_USER=root
      - MYSQL_PORT=3307
      - MYSQL_PWD=#robo@tw_2024
      - MYSQL_DBNAME=robo-db
      - LOG_FILE=/var/python/logs/info.log
      - LOG_HANDLERS=[console,file]
    volumes:
      - ./robo-dividend:/usr/src/app
      - ./logs/:/var/python/logs
    restart: always
    depends_on:
      - robo-db
    ports:
      - "8080:8080"
  robo-db:
    image: mysql:latest
    container_name: robo-db
    ports:
      - "3307:3307"
    environment:
      - TZ=Asia/Shanghai
      - MYSQL_ROOT_PASSWORD=changeit
      - MYSQL_DATABASE=mdis_prr3
    volumes:
      - ./conf/mysql/my.cnf:/etc/my.cnf:ro
      - ./mysql-data:/var/lib/mysql:rw
