首页 > 系统相关 >记录一下docker desktop windows安装,容器安装等

记录一下docker desktop windows安装,容器安装等

时间:2024-04-27 11:12:13浏览次数:17  
标签:set http header windows desktop nginx proxy gzip 安装

安装包下载

https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe  

 

   
docker应用管理工具,选择性安装 https://www.rainbond.com/docs/quick-start/quick-install https://www.bilibili.com/video/BV1MZ4y1b7wW/?p=2&spm_id_from=pageDriver&vd_source=b44203991b8ee2e43d764088707392f5

解决“无法加载文件 ***\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本”


Rabbitmq 安装命令

docker run -d --hostname rabbitmq --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:latest docker exec -it rabbitmq /bin/bash -c "rabbitmq-plugins enable rabbitmq_management"

1. 运行RabbitMQ容器

docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

2. 进入RabbitMQ容器

docker exec -it rabbitmq bash

3. 使用rabbitmqctl命令创建用户

rabbitmqctl add_user yaya yaya rabbitmqctl set_user_tags yaya administrator rabbitmqctl set_permissions -p / yaya ".*" ".*" ".*"   REDIS docker run -d --name myredis -p 6379:6379 redis --requirepass "123456"
Nginx etc/nginx/conf.d/default.conf, etc/nginx/nginx.conf
server {
    listen       20005;
    server_name  localhost;

    client_max_body_size 100M;

    set $cache max-age=86400;
    location / {
        root   /usr/share/nginx/html;
        #解决页面刷新404问题
        try_files $uri $uri/ @router;
        index  index.html index.htm;

        add_header Access-Control-Allow-Origin *;
        add_header Cache-Control $cache;
        add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
        add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
 
        if ($request_method = 'OPTIONS') {
            return 204;
        }
    }

    # 由于路由的资源不一定是真实的路径,无法找到具体文件
    # 所以需要将请求重写到 index.html 中,然后交给真正的 Vue 路由处理请求资源
    location @router {
        add_header Cache-Control $cache;
        rewrite ^.*$ /index.html last;
    }
 
    # 关键步骤,这里表示将所有的 http://172.18.1.82:80/api/ 开头的请求都转发到下面 proxy_pass 指定的链接中
    # 为了防止在访问页面时请求就被 Nginx 代理转发,这里需要更具体的配置,才能和前端访问请求区分开
    location /api/ {
        # 后端的真实接口
        proxy_pass http://localhost:8000/;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Cookie $http_cookie;
        # for Ajax
        #fastcgi_param HTTP_X_REQUESTED_WITH $http_x_requested_with;
        proxy_set_header HTTP-X-REQUESTED-WITH $http_x_requested_with;
        proxy_set_header HTTP_X_REQUESTED_WITH $http_x_requested_with;
        proxy_set_header x-requested-with $http_x_requested_with;
        client_max_body_size 100m;
        client_body_buffer_size 128k;
        proxy_connect_timeout 90;
        proxy_send_timeout 90;
        proxy_read_timeout 90;
        proxy_buffer_size 128k;
        proxy_buffers 32 32k;
        proxy_busy_buffers_size 128k;
        proxy_temp_file_write_size 128k;
    }
}
user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    # 开启和关闭gzip模式
    gzip on;
    # gizp压缩起点,文件大于1k才进行压缩
    gzip_min_length 1k;
    # 设置压缩所需要的缓冲区大小,以4k为单位,如果文件为7k则申请2*4k的缓冲区
    gzip_buffers 4 16k;
    # 设置gzip压缩针对的HTTP协议版本
    gzip_http_version 1.0;
    # gzip 压缩级别,1-9,数字越大压缩的越好,也越占用CPU时间
    gzip_comp_level 5;
    # 进行压缩的文件类型
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x    -httpd-php application/javascript application/json;
    # 是否在http header中添加Vary: Accept-Encoding,建议开启
    gzip_vary on;

    include /etc/nginx/conf.d/*.conf;
}


拉去前端文件放Nginx里面 源:/root/home/web 目的:C:\Users\admin\Desktop\yaya_nginx\web 各个文件夹dist解压到dist:比如 C:\Users\admin\Desktop\yaya_nginx\nginx\nginx-erp\dist.zip 压缩文件 C:\Users\admin\Desktop\yaya_nginx\nginx\nginx-erp\dist 文件夹  
NGINX批量启动脚本和停止
@echo off
set nginx_path=C:\Users\admin\Desktop\yaya_nginx\nginx

cd "%nginx_path%\nginx-scm
start  "nginx" "%nginx_path%\nginx-scm\nginx.exe"
cd ../nginx-ums
start  "nginx" "%nginx_path%\nginx-ums\nginx.exe"
cd ../nginx-erp
start  "nginx" "%nginx_path%\nginx-erp\nginx.exe"
cd ../nginx-mes
start  "nginx" "%nginx_path%\nginx-mes\nginx.exe"
cd ../nginx-plm
start  "nginx" "%nginx_path%\nginx-plm\nginx.exe"

timeout 10

@echo off
taskkill /f /im nginx.exe
exit

标签:set,http,header,windows,desktop,nginx,proxy,gzip,安装
From: https://www.cnblogs.com/liran123/p/18161828

相关文章

  • windows bilibili客户端缓存视频导出
    视频缓存地址:C:\Users\Administrator\Videos\bilibili\一串数字使用winhex把视频和音频前面的八个0删除使用ffmpeg合并视频和音频ffmpeg-i视频文件-i音频文件-codeccopy输出地址......
  • ubuntu terminator 安装美化
    首先安装terminatorapt-getinstallterminator因为初始界面不太美观,可以设置一下配置文件,方法如下:mkdir~/.config/terminator/nano~/.config/terminator/config我当前使用的配置如下:[global_config]always_split_with_profile=Truetitle_font=UbuntuMono......
  • Debian/Linux安装 Realtek 8811cu无线网卡驱动
    1、下载必备安装包make、gcc(debian中可用build-essential包)、bc、linux-headers-$(uname-r)、dkmssudoaptinstallbuild-essentialbcsudoaptinstalllinux-headers-$(uname-r)dkms2、在github中下载8811cu的驱动(8811cu和8821cu用的同一个驱动),注意下驱动程序是否能......
  • WDS+MDT网络启动自动部署windows(十)硬盘分区格式化全自动
    简介:虽然WDS+MDT在单硬盘很方便,但是各种大硬盘,小固态加大硬盘的地方,还是有若干不便之处。如:第二块硬盘未分区格式化,需要手动选择安装磁盘,如果固态超过250G,是否需要分为两个区?自动选择较小的硬盘目前我这里的终端都是小固态,大机械,那么我们要尝试一下自动选择较小的硬盘作为系统......
  • 陈畅亮搞的专利在Windows上利用加解密DLL模块对数据库连接字符串进行加解密
    陈畅亮搞的专利在Windows上利用加解密DLL模块对数据库连接字符串进行加解密  这种专利权人是公司,个人是发明人,专利年费是申请人先垫付,然后公司报销了,这个专利本身就不属于员工的这个是公司是专利权人, 使用权是公司,如果想要维持权利的话,需要缴纳年费,专利发明现在一个市......
  • zabbix监控安装文档
    Zabbix安装部署文档https://blog.csdn.net/m0_56055257/article/details/131260948以上文档可以直接复制内容部署,写的非常好用在本教程中,展示如何在CentOS8/RHEL8/OracleLinux8/AlmaLinux8/RockyLinux8上安装最新的Zabbix6.4 版本。1、基本配置1.0关闭防火墙......
  • 在win11电脑安装ubuntu双系统详细教程
    ​ 一、制作Ubuntu系统盘下载UbuntuISO镜像:访问Ubuntu官方网站下载最新的Ubuntu18.04LTS(长期支持版)ISO镜像。阿里云开源镜像站:https://mirrors.aliyun.com/ubuntu-releases/ 清华大学开源软件镜像网站:https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/选择想要......
  • kubernetes安装配置使用vGPU
    前言AI落地时,在某些场景下AI模型在训练或者是推理时,其算力要求不需要占用整卡的GPU,比如只需要0.5卡GPU即可满足需求。在这种情况下,可以使用GPU虚拟化技术来解决这个问题,将整卡的GPU虚拟化为两个0.5卡的GPU,这样就可以在一张卡上同时跑两个AI训练或者AI推理应用服......
  • notepad++ 安装compare文件对比插件&失败解决办法
    1.首先notepad++安装compare方法:在菜单栏点击“插件”》插件管理   搜索:compare 点击YES 因为国内网络原因,可能会安装失败,也可能安装比较久。2.自己解压安装:  下载解压包:链接:https://pan.baidu.com/s/1B8hZJCJ8PLZgwdYzQeWGpQ提取码:7n2s  点击打开插件......
  • lib 安装失败,error Microsoft Visual C++ 14.0 is required.
    即使安装c++要占用c盘4G,而且仍然有可能报错,error:command'C:\ProgramFiles(x86)\MicrosoftVisualStudio14.0\VC\BIN\x86_amd64\cl.exe'failedwithexitstatus2另一种解决方法是直接下载whl,省去编译的过程https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib有可能......