当前位置: 首页> 房产> 建筑 > 广州建站代运营公司有哪些_大连建设局官网_公司广告推广_最新国际新闻事件

广州建站代运营公司有哪些_大连建设局官网_公司广告推广_最新国际新闻事件

时间:2025/8/4 20:02:55来源:https://blog.csdn.net/z284747/article/details/144198313 浏览次数:0次
广州建站代运营公司有哪些_大连建设局官网_公司广告推广_最新国际新闻事件
  1. 编写 Dockerfile 文件:
FROM nginx:latest
ADD dist /etc/nginx/html/dist
COPY nginx.conf /etc/nginx/nginx.conf
ENV PATH /usr/sbin:$PATH
EXPOSE 80
ENTRYPOINT ["nginx"]
CMD ["-g","daemon off;"]
  1. 编写 nginx.conf 文件:
user  root;
worker_processes  auto;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;sendfile        off;tcp_nopush     on;server_tokens   off;keepalive_timeout  65;client_max_body_size 1000m;client_header_buffer_size 512k;large_client_header_buffers 4 512k;server {listen       80;server_name  localhost;gzip on;gzip_min_length 1k;gzip_buffers 4 16k;gzip_comp_level 6;gzip_vary on;gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;#charset koi8-r;#access_log  logs/host.access.log  main;location / {add_header X-Frame-Options "SAMEORIGIN";add_header Cache-Control "no-cache";root    html/dist;index   index.html;try_files $uri $uri/ /index.html;}location /new/oliver/ {            proxy_pass http://127.0.0.1:9090;rewrite "^/new/(.*)$" /$1 break;}location /oliver/ {proxy_http_version 1.1;proxy_pass http://172.30.10.141:11213;#proxy_pass_request_headers on;#proxy_set_header Host $http_host;#proxy_set_header Connection "";client_max_body_size    1024m;client_body_buffer_size 128k;proxy_redirect off;proxy_connect_timeout   900;proxy_send_timeout      900;proxy_read_timeout      900;proxy_buffer_size       4k;proxy_buffers           4 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k;proxy_next_upstream http_502 http_504 error invalid_header;}location /zhong/ {proxy_pass http://api.oliver.com;proxy_http_version 1.1;proxy_set_header Connection "";rewrite "^/zhong/(.*)$" /$1 break;}location /tyler/ {            proxy_pass http://192.168.56.200:8999;rewrite "^/tyler/(.*)$" /$1 break;}location /ai {            proxy_pass https://tylerzhong.ai.com;}}
}
  1. 将 Dockerfile 打成镜像
docker build -t tylerApp:latest .
  1. 运行 tylerApp 镜像
docker run -id --name tylerApp -p 80:80 tylerApp
  1. 浏览器访问项目

http://ip:port/


扩展:

如果要将打包好的镜像发送给别人,让别人部署,则可以将镜像打成 tar 包,然后将 tar 包发送给别人。

docker save -o tylerApp.tar tylerApp

由于 Docker 镜像文件可能比较大,可以将 .tar 文件进行压缩以减少文件大小,便于发送。可以使用 tar 或 zip 等工具压缩:

tar -czvf tylerApp.tar.gz tylerApp.tar

或者使用 zip:

zip tylerApp.tar.gz tylerApp.tar

对方收到镜像文件后,需执行以下命令来加载 Docker 镜像:

docker load -i tylerApp.tar.gz

如果是压缩文件,需要先解压:

tar -xzvf tylerApp.tar.gz
docker load -i tylerApp.tar
关键字:广州建站代运营公司有哪些_大连建设局官网_公司广告推广_最新国际新闻事件

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: