美文网首页
Docker 创建mysql、nginx、elasticsear

Docker 创建mysql、nginx、elasticsear

作者: 第二沦陷区 | 来源:发表于2021-11-19 11:39 被阅读0次

    创建 nginx

    docker run -d --name nginx \
         -v /fx_logs/docker/nginx/www:/www \
         -v /fx_logs/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
         -v /fx_logs/docker/nginx/conf/conf.d:/etc/nginx/conf.d \
         -p 80:80 \
         --restart=always \
         --network fx_network \
         nginx:latest
    

    创建 mysql

    docker run -d --name mysql \
        -v /fx_logs/docker/mysql/conf:/etc/mysql \
        -v /fx_logs/docker/mysql/logs:/var/log/mysql \
        -v /fx_logs/docker/mysql/data:/var/lib/mysql \
        -v /fx_logs/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf \
        -p 3306:3306 \
        -e MYSQL_ROOT_PASSWORD=123!#%456 \
        --restart=always \
            --network fx_network \
        mysql:5.7.36
    

    创建 elasticsearch 可以创建多个集群

    docker run -d --name es_node1 \
         -v /fx_logs/docker/es/config/es_node1_6.8.20.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
         -v /fx_logs/docker/es/config/certs:/usr/share/elasticsearch/config/certs \
         -v /fx_logs/docker/es/plugins:/usr/share/elasticsearch/plugins \
         -v /fx_logs/docker/es/data/node1:/usr/share/elasticsearch/data \
         -v /etc/localtime:/etc/localtime \
         -e ES_JAVA_OPTS="-Xms4G -Xmx4G" \
         --restart=always \
         --network fx_network \
         elasticsearch:6.8.20
    

    相关文章

      网友评论

          本文标题:Docker 创建mysql、nginx、elasticsear

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