version: "3"
services:
  pas-mysql:
    container_name: pas-mysql
    image: mysql:8
    ports:
      - "3307:3306"
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: cslg_docker_123456
      MYSQL_DATABASE: pas
    volumes:
      - "./mysql/conf.d/:/etc/mysql/conf.d/"
      - "./mysql/init/:/docker-entrypoint-initdb.d/"
    privileged: true
    restart: always
  pas-redis:
    container_name: pas-redis
    image: redis
    ports:
      - "6380:6379"
    command:
      --requirepass "cslg_docker_123456"
    restart: always
  pas-api:
    container_name: pas-api
    build:
      context: ./api
    ports:
      - "8879:8879"
    environment:
      TZ: Asia/Shanghai
    volumes:
      - "./api/logs:/logs"
      - "./api/file:/file"
      - "./api/backup:/backup"
    restart: always
    depends_on:
      - pas-mysql
      - pas-redis
  pas-web:
    container_name: pas-web
    build:
      context: ./web
    ports:
      - "8085:80"
    volumes:
      - "./web/nginx:/var/log/nginx"
    restart: always
