version: '3'
services:
  mariadb:
    container_name: mariadb
    image: mariadb
    restart: always
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: 你的root用户密码
      # 初始化数据库（后续的初始化 SQL 会在这个库执行）
      MYSQL_DATABASE: continew_admin
      #MYSQL_USER: 你的数据库用户名
      #MYSQL_PASSWORD: 你的数据库密码
    ports:
      - '3306:3306'
    volumes:
      - /docker/mysql/:/var/lib/mysql
    privileged: true
  redis:
    container_name: redis
    image: redis:6.2.7
    restart: always
    environment:
      TZ: Asia/Shanghai
    ports:
      - '6379:6379'
    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 123456'
    privileged: true
  continew-admin-server:
    container_name: continew-admin-server
    build: ./continew-admin
    restart: always
    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: 你的 Redis 数据库索引
    ports:
      - '18000:18000'
    volumes:
      - /docker/continew-admin/logs:/logs
      - /docker/continew-admin/data/file:/data/file
      - /docker/continew-admin/data/avatar:/data/avatar
    depends_on:
      - redis
      - mariadb
    privileged: true
  nginx:
    container_name: nginx
    image: nginx:1.22.1
    restart: always
    environment:
      TZ: Asia/Shanghai
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
      - /docker/nginx/logs:/var/log/nginx
      - /docker/nginx/cert:/etc/nginx/cert
      - /docker/continew-admin/web:/usr/share/nginx/html
    privileged: true