美文网首页编什么程
fpm、redis、nginx、mysql容器docker-co

fpm、redis、nginx、mysql容器docker-co

作者: 沙蒿同学 | 来源:发表于2020-01-20 14:35 被阅读0次
    • fpm
    version: "3"
    services:
        php-fpm:
            container_name: php-fpm
            image: php:7.3-fpm-alpine
            user: www-data
            network_mode: "host"
            restart: always
            working_dir: /app
            volumes:
              - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
              - /opt/test:/app/test
    
    • redis
    version: "3"
    services:
      redis:
        container_name: redis
        image: redis:5-alpine
        user: root
        network_mode: "host"
        volumes:
          - ./database:/data
          - ./redis.conf:/usr/local/etc/redis/redis.conf
        command: redis-server /usr/local/etc/redis/redis.conf
    
    • nginx
    version: "3"
    services:
      nginx:
        container_name: nginx
        image: nginx:1.16-alpine
        restart: always
        network_mode: "host"
        environment:
          - "USER=www"
        volumes:
          - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
          - /opt/test:/app/test
          - /opt/bll-doc:/app/bll-doc
          - ./conf.d:/etc/nginx/conf.d
          - ./nginx.conf:/etc/nginx/nginx.conf
          - ./logs:/var/log/nginx
    
    • mysql
    version: "3"
    services:
      mysql:
        container_name: mysql
        image: mysql:8
        #restart: always
        environment:
          MYSQL_ROOT_HOST: '%'
          MYSQL_ROOT_PASSWORD: 'middlewarepwd'
        network_mode: "host"
        volumes:
          - ./mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
          - ./database:/var/lib/mysql
        command: --default-authentication-plugin=mysql_native_password
    

    相关文章

      网友评论

        本文标题:fpm、redis、nginx、mysql容器docker-co

        本文链接:https://www.haomeiwen.com/subject/ojujzctx.html