当前位置: 首页 > 工具软件 > hyperf-admin > 使用案例 >

hyperf docker-compose 安装

欧阳俊晖
2023-12-01
version: '3'
services:
  mysql:
    image: mysql:5.7
    container_name: hdzs-mysql
    ports:
      - "33069:3306"
    volumes:
      - ./mysql/lib/mysql:/var/lib/mysql
      - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
    environment:
      - TZ=Asia/Shanghai
      - MYSQL_ROOT_PASSWORD=root
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    networks:
      - hdzs_net
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: hdzs-phpmyadmin
    ports:
      - "8099:80"
    environment:
      - PMA_ARBITRARY=1
      - MYSQL_USER=root
      - MYSQL_PASSWORD=root
      - MYSQL_ROOT_PASSWORD=root
      - PMA_HOST=mysql
    depends_on:
      - mysql
    networks:
      - hdzs_net
  redis:
    image: redis
    container_name: hdzs-redis
    ports:
      - "63799:6379"
    volumes:
      - ./redis/data/:/data/
      - ./redis/redis.conf:/redis.conf
    environment:
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
    networks:
      - hdzs_net
    command: redis-server --requirepass root --appendonly yes
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
  phpredisadmin:
    image: erikdubbelboer/phpredisadmin
    container_name: hdzs-phpredisadmin
    ports:
      - "8089:80"
    environment:
      - REDIS_1_HOST=redis
      - REDIS_1_PORT=6379
      - REDIS_1_AUTH=root
      - ADMIN_USER=root
      - ADMIN_PASS=root
    depends_on:
      - redis
    networks:
      - hdzs_net
  hyperf-dev:
    container_name: hdzs-hyperf
    image: hyperf/hyperf:7.4-alpine-v3.11-swoole
    working_dir: /data
    ports:
      - "9503:9503"
      - "9504:9504"
    volumes:
      - "./:/data"
    depends_on:
      - redis
      - mysql
    stdin_open: true
    tty: true
    networks:
      - hdzs_net
networks:
  hdzs_net:

在hyperf镜像安装hyperf代码,修改对应的端口和env配置就可以运行了

 类似资料: