Docker Compose 一键启动 OpenAI Chatgpt

Docker Compose 一键启动 OpenAI Chatgpt
Photo by NEOM / Unsplash
version: '3'
services:
  mysql_gpt:
    image: dockerepos/chatgpt-web-java-mysql:latest
    container_name: mysql_gpt
#    ports:
#      - 3309:3306
    volumes:
      - ~/mydata/mysql/data:/var/lib/mysql #数据文件挂载
      - ~/mydata/mysql/conf:/etc/mysql/conf.d #配置文件挂载
      - ~/mydata/mysql/log:/var/log/mysql #日志文件挂载
    networks:
      gpt_network:
    healthcheck:
      test: [ "CMD", "mysqladmin" ,"ping" , "-h", "localhost" ]
      interval: 5s
      timeout: 10s
      retries: 5
  java_gpt:
    image: dockerepos/chatgpt-web-java:latest
    container_name: javagpt
    environment:
      - JDBC_URL=jdbc:mysql://mysql_gpt:3306/chat?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
      - MYSQL_USER_NAME=root
      - MYSQL_PASSWORD=123456
      - CHAT_OPENAI_API_KEY=sk-xxxxx  # 替换成自己Openai API Key
      - CHAT_OPENAI_ACCESS_TOKEN=
      - CHAT_OPENAI_API_BASE_URL=https://cha.bigitong.xyz/ #可更换成自己的Openapi反向代理
      - CHAT_HTTP_PROXY_HOST:127.0.0.1
      - EMAIL_HOST=smpt.163.com
      - EMAIL_PORT=994
      - EMAIL_FROM=xxxxx0@163.com
      - EMAIL_USER=xxx
      - EMAIL_PASS=xxx
    ports:
      - 3002:3002
    depends_on:
      - mysql_gpt
    restart: on-failure
    networks:
      gpt_network:
  web_gpt:
    image: dockerepos/web_gpt
    container_name: web_gpt
    ports:
      - 1002:1002
    networks:
      gpt_network:

networks:
  gpt_network: