首页 手册笔记 ✒️

version: '3'
services:
  db:
      image: mysql:5.7
      container_name: mysql
      command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
      hostname: mysql
      restart: always
      environment:
        - TZ=Asia/Shanghai
        - MYSQL_ROOT_PASSWORD=my-secret-pw
      volumes:
        - ./docker/mysql/conf/my.cnf:/etc/my.cnf
        - ./docker/mysql/data:/var/lib/mysql
      ports:
        - 3306:3306

  redis:
      image: redis:6.0
      container_name: redis
      hostname: redis
      restart: always
      environment:
        - TZ=Asia/Shanghai
      ports:
        - 6379:6379

  oss:
      image: minio/minio:RELEASE.2021-04-06T23-11-00Z # 旧版Minio
      container_name: minio
      command: server /data
      hostname: minio
      restart: always
      environment:
        - TZ=Asia/Shanghai
        - MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE
        - MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
      volumes:
        - ./docker/minio:/data
      ports:
        - 9000:9000


# 容器可以加入到已经存在的网络,这里 name 就是指定已经存在的网络名称
networks: 
  default:
    external: 
      name: default_network



文章评论