当前位置:首页 >> 建站知识 >> 网站建设

ThinkCMF更换mysql版本+phpmyadmin Docker Compose YML文件样例

发布时间:2023-12-03 09:43:07   浏览次数:74次   作者:pawbox建站

docker-compose.yml


version: "3"

services:

  nginx:

    image: nginx:alpine

    restart: always

    container_name: thinkcmf-nginx

    ports:

      - "8000:80"

    volumes:

      - ./www/thinkcmf/:/var/www/html/:rw

      - ./nginx/nginx.conf:/etc/nginx/nginx.conf

    networks:

      - web

  php-fpm:

    image: thinkcmfpro/thinkcmf:latest

    restart: always

    container_name: thinkcmf-php-fpm

    volumes:

      - ./www/thinkcmf/:/var/www/html/:rw

      - ./php/php.ini:/usr/local/etc/php/conf.d/php.ini

    environment:

      - DATABASE_HOSTNAME=mysql

      - DATABASE_USERNAME=你的mysql用户名

      - DATABASE_PASSWORD=你的mysql密码

      - DATABASE_DATABASE=你的thinkCMF要连接的数据库    

    networks:

      - web

  mysql:

    image: mysql:5.7.42

    restart: always

    container_name: thinkcmf-mysql

    hostname: thinkcmf-mysql

    environment:

      MYSQL_ROOT_PASSWORD: 你的Mysql root密码

      MYSQL_DATABASE: 你的thinkCMF要连接的数据库

      MYSQL_USER: 你的mysql用户名

      MYSQL_PASSWORD: 你的mysql密码     

      TZ: Asia/Shanghai

    ports:

      - "13306:3306"    

    volumes:

      - ./data:/var/lib/mysql

      - ./conf/my.cnf:/etc/mysql/my.cnf

    command:

      --max_connections=1000

      --character-set-server=utf8mb4

      --collation-server=utf8mb4_general_ci

      --default-authentication-plugin=mysql_native_password    

    networks:

      - web

  redis:

    image: redis:alpine

    restart: always

    container_name: thinkcmf-redis

    volumes:

      - ./redis/data:/data

    networks:

      - web

  phpmyadmin:

    image: phpmyadmin:latest

    container_name: thinkcmf-mysql-manage

    environment:

      - PMA_HOST=mysql

      - PMA_PASSWORD=你的Mysql root密码

      - PMA_ARBITRARY=1

    ports:

      - "1000:80"

    links:

      - mysql

    networks:

      - web

    restart: always  

    deploy:

      resources:

        limits:

          memory: 500M    


  phpredisadmin:

    image: erikdubbelboer/phpredisadmin

    container_name: thinkcmf-redis-manage

    environment:

      - TZ=Asia/Shanghai

      - REDIS_1_HOST=redis

      - REDIS_1_PORT=6379

      - ADMIN_USER=你的redis用户名

      - ADMIN_PASS=你的redis密码

    ports:

      - "2000:80"

    depends_on:

      - redis

    networks:

      - web

    restart: always

networks:

  web: