version: '3'
services:
  mysql:
    image: mysql:8.0.33
    restart: always
    container_name: mysql
    ports:
      - '3306:3306'
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: 你的root用户密码
      # 初始化数据库（后续的初始化 SQL 会在这个库执行）
      MYSQL_DATABASE: continew_admin
      #MYSQL_USER: 你的数据库用户名
      #MYSQL_PASSWORD: 你的数据库密码
    volumes:
      - /docker/mysql/conf/:/etc/mysql/conf.d/
      - /docker/mysql/data/:/var/lib/mysql/
    command:
      --default-authentication-plugin=mysql_native_password
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_general_ci
      --explicit_defaults_for_timestamp=true
      --lower_case_table_names=1
  redis:
    image: redis:7.2.3
    restart: always
    container_name: redis
    ports:
      - '6379:6379'
    environment:
      TZ: Asia/Shanghai
    volumes:
      - /docker/redis/conf/redis.conf:/usr/local/redis/config/redis.conf
      - /docker/redis/data/:/data/
      - /docker/redis/logs/:/logs/
    command: 'redis-server /usr/local/redis/config/redis.conf --appendonly yes --requirepass 你的 Redis 密码'
  continew-admin-server:
    build: ./continew-admin
    restart: always
    container_name: continew-admin-server
    ports:
      - '18000:18000'
    environment:
      TZ: Asia/Shanghai
      DB_HOST: 172.17.0.1
      DB_PORT: 3306
      DB_USER: 你的数据库用户名
      DB_PWD: 你的数据库密码
      DB_NAME: continew_admin
      REDIS_HOST: 172.17.0.1
      REDIS_PORT: 6379
      REDIS_PWD: 你的 Redis 密码
      REDIS_DB: 0
    volumes:
      - /docker/continew-admin/config/:/app/config/
      - /docker/continew-admin/data/file/:/app/data/file/
      - /docker/continew-admin/logs/:/app/logs/
      - /docker/continew-admin/lib/:/app/lib/
    depends_on:
      - redis
      - mysql
  nginx:
    image: nginx:1.25.3
    restart: always
    container_name: nginx
    ports:
      - '80:80'
      - '443:443'
    environment:
      TZ: Asia/Shanghai
    volumes:
      - /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
      - /docker/nginx/cert/:/etc/nginx/cert/
      - /docker/nginx/logs/:/var/log/nginx/
      # 前端页面目录
      - /docker/continew-admin/html/:/usr/share/nginx/html/
