services:
  nginx:
    container_name: udyk-nginx
    image: registry.cn-shanghai.aliyuncs.com/youdeyunke/pro:nginx-6.2.668
    restart: always
    volumes:
      - ./data/upload:/app/filestore
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
    ports:
      - ${PANEL_APP_PORT_HTTP}:80
    depends_on:
      - server
      - www

  server:
    container_name: udyk-server
    image: registry.cn-shanghai.aliyuncs.com/youdeyunke/pro:server-6.2.668
    privileged: true                # 注意，不能去掉
    restart: on-failure:5
    expose:
      - 8080
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
    depends_on:
      - redis
      - db
    volumes:
      - ./data/app:/app

  www:
    container_name: udyk-www
    image: registry.cn-shanghai.aliyuncs.com/youdeyunke/pro:www-6.2.668
    restart: always
    user: root
    expose:
      - 3000
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
    depends_on:
      - server
      - db

  redis:
    container_name: udyk-redis
    restart: always
    image: registry.cn-shanghai.aliyuncs.com/youdeyunke/common:redis-4.0
    command: redis-server --bind 0.0.0.0  --appendonly yes
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
    volumes:
      - ./data/redis:/data
    expose:
      - 6379

  db:
    container_name: udyk-db
    image: registry.cn-shanghai.aliyuncs.com/youdeyunke/common:mysql-8.0.3
    expose:
      - 3306
    volumes:
      - ./data/mysql:/var/lib/mysql
    environment:
      LANG: C.UTF-8
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: udyk@2023
    restart: always
