{"id":46799,"date":"2025-07-30T04:11:52","date_gmt":"2025-07-29T20:11:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/46799.html"},"modified":"2025-07-30T04:11:52","modified_gmt":"2025-07-29T20:11:52","slug":"%e5%a4%9a%e6%a8%a1%e5%9d%97%ef%bc%8c%e6%a8%a1%e5%9d%97%e4%b8%ad%e5%b5%8c%e5%a5%97%e7%9a%84springboot%e9%a1%b9%e7%9b%ae%ef%bc%8c%e8%bf%9c%e7%a8%8b%e9%83%a8%e7%bd%b2%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/46799.html","title":{"rendered":"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b"},"content":{"rendered":"<h4>\u670d\u52a1\u5668&#xff1a;\u8fdc\u7a0b\u670d\u52a1\u5668\u5b9e\u4f8b \u6bd4\u5982\u67d0\u4e3a\u7684\u670d\u52a1\u5668<\/h4>\n<h4>\u9879\u76ee&#xff1a;\u540e\u7aef\u662fspringboot\u6bd4\u8f83\u590d\u6742\u7684\u6a21\u5757\u7ed3\u6784&#xff0c;\u7ba1\u7406\u4f9d\u8d56\u7684\u6a21\u5757A&#xff0c;\u670d\u52a1\u6a21\u5757B&#xff0c;\u7cfb\u7edf\u6a21\u5757C&#xff0c;\u6a21\u5757C\u4e0b\u9762\u53c8\u6709\u5b50\u6a21\u5757D&#xff0c;\u7b49\u7b49\u3002\u524d\u7aef\u662fVue3 &#043; element-plus \u7684\u9879\u76ee\u3002<\/h4>\n<h4>\u6253\u5305\u65b9\u5f0f&#xff1a;\u5229\u7528docker\u3002\u8fdc\u7a0b\u670d\u52a1\u5668\u5148\u5b89\u88c5docker&#xff0c;\u7136\u540e\u5229\u7528docker\u5b89\u88c5redis&#xff0c;mysql&#xff0c;nginx&#xff0c;\u5229\u7528docker\u6253\u5305\u540e\u7aef\u9879\u76ee\u3002\u524d\u7aef\u7684\u8bdd\u4ea4\u7ed9nginx&#xff0c;\u4e0d\u7528docker\u521b\u5efa\u524d\u7aef\u5b9e\u4f8b\u4e86&#xff0c;\u56e0\u4e3a\u6709\u4e86nginx&#xff0c;\u524d\u7aef\u76f8\u5f53\u4e8e\u9759\u6001\u8d44\u6e90\u4e86\u3002<\/h4>\n<p>\u8bf4\u660e&#xff1a;\u9879\u76ee\u5148\u5728\u672c\u5730\u542f\u52a8\u6b63\u5e38&#xff0c;\u7136\u540e\u53ef\u4ee5\u6b63\u5e38\u6253\u5305\u6210jar\u5305\u3002<span style=\"color:#fe2c24\">\u65e0\u8bba\u540e\u7aef\u591a\u590d\u6742\u7684\u6a21\u5757&#xff0c;\u5176\u5b9e\u90e8\u7f72\u7684\u65f6\u5019\u53ea\u9700\u8981\u7528\u5230\u8fd0\u884c\u6a21\u5757\u4e0b\u9762\u7684jar\u5305\u5c31\u884c\u4e86\u3002\u6bd4\u5982\u6211\u7684\u542f\u52a8\u7c7b\u5728B\u6a21\u5757&#xff0c;\u90a3\u4e48\u5c31\u662f\u9700\u8981B\u6a21\u5757\u4e0b\u7684target\u6587\u4ef6\u91cc\u9762\u7684jar\u6587\u4ef6\u3002\u56e0\u4e3a\u5229\u7528docker\u90e8\u7f72\u5bb9\u5668&#xff0c;\u800c\u4e14\u6211\u4eec\u914d\u7f6e\u7684\u65f6\u5019\u9009\u62e9\u5bb9\u5668\u540d\u800c\u4e0d\u662fip\u5730\u5740&#xff0c;\u6240\u4ee5\u521b\u5efa\u7684\u5bb9\u5668\u9700\u8981\u52a0\u5165\u4e00\u4e2a\u76f8\u5f53\u4e8edocker\u5185\u90e8\u7684\u5185\u7f51my-network&#xff0c;\u8fd9\u6837\u624d\u80fd\u88ab\u8bc6\u522b&#xff0c;\u4e92\u76f8\u901a\u4fe1\u3002\u8fd8\u6709\u5c31\u662f\u8fdc\u7a0b\u5b9e\u4f8b\u7533\u8bf7\u7684\u57df\u540d\u8fd8\u6ca1\u6709\u5ba1\u6279\u4e0b\u6765&#xff0c;\u53ea\u80fd\u662f\u5148\u7528\u8fdc\u7a0bip\u6765\u90e8\u7f72\u3002\u540e\u7eed\u7533\u8bf7\u4e0b\u6765\u540e&#xff0c;\u4f1a\u6539\u4e3a\u57df\u540d\u90e8\u7f72\u3002<\/span><\/p>\n<h2>1.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u5b89\u88c5docker<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u670d\u52a1\u5668\u662f\u81ea\u5df1\u5728\u67d0\u4e3a\u4e70\u4e86&#xff0c;\u4e00\u5e74&#xff0c;\u51e0\u5341\u5757\u94b1&#xff0c;\u6bd4\u8f83\u5212\u7b97\u3002<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u4ee5\u4e0b\u662f Ubuntu \u7cfb\u7edf\u5b89\u88c5 Docker \u7684\u8be6\u7ec6\u6b65\u9aa4&#xff08;\u57fa\u4e8e\u5b98\u65b9\u4ed3\u5e93&#xff0c;\u7a33\u5b9a\u53ef\u9760&#xff09;&#xff0c;\u6db5\u76d6\u73af\u5883\u51c6\u5907\u3001\u5b89\u88c5\u3001\u9a8c\u8bc1\u53ca\u4f18\u5316\u914d\u7f6e<\/p>\n<p>1&#xff09;\u524d\u7f6e\u51c6\u5907&#xff1a;\u5378\u8f7d\u65e7\u7248\u672c&#xff08;\u82e5\u6709&#xff0c;\u65b0\u7cfb\u7edf\u76f4\u63a5\u8df3\u8fc7&#xff09;<\/p>\n<p>sudo apt remove docker docker-engine docker.io containerd runc<br \/>\nsudo apt purge -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras<br \/>\nsudo rm -rf \/var\/lib\/docker<br \/>\nsudo rm -rf \/var\/lib\/containerd<\/p>\n<p>2&#xff09;\u66f4\u65b0\u7cfb\u7edf\u5305\u7d22\u5f15<\/p>\n<p>sudo apt update<br \/>\nsudo apt upgrade -y # \u53ef\u9009&#xff0c;\u66f4\u65b0\u7cfb\u7edf\u5df2\u5b89\u88c5\u5305&#xff08;\u8017\u65f6\u7a0d\u957f&#xff09;<\/p>\n<p>3&#xff09;\u5b89\u88c5\u4f9d\u8d56\u5305<\/p>\n<p>sudo apt install -y ca-certificates curl gnupg lsb-release<\/p>\n<p>4&#xff09;\u6dfb\u52a0 Docker \u5b98\u65b9 GPG \u5bc6\u94a5<\/p>\n<p>sudo mkdir -p \/etc\/apt\/keyrings<br \/>\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg &#8211;dearmor -o \/etc\/apt\/keyrings\/docker.gpg<\/p>\n<p>5&#xff09;\u6dfb\u52a0 Docker \u5b98\u65b9\u8f6f\u4ef6\u6e90<\/p>\n<p>echo<br \/>\n&#034;deb [arch&#061;(dpkg &#8211;print-architecture) signed-by&#061;\/etc\/apt\/keyrings\/docker.gpg] https:\/\/download.docker.com\/linux\/ubuntu \\\\ (lsb_release -cs) stable&#034; | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/p>\n<p>6&#xff09;\u518d\u6b21\u66f4\u65b0\u5305\u7d22\u5f15<\/p>\n<p>sudo apt update<\/p>\n<p>7&#xff09;\u5b89\u88c5 Docker \u5f15\u64ce&#xff08;CE \u793e\u533a\u7248&#xff09;<br \/>\n\u5b89\u88c5 Docker \u6838\u5fc3\u7ec4\u4ef6&#xff08;docker-ce\u3001containerd \u7b49&#xff09;<\/p>\n<p>sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/p>\n<p>8&#xff09;\u542f\u52a8 Docker \u670d\u52a1\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\n\u786e\u4fdd Docker \u968f\u7cfb\u7edf\u542f\u52a8&#xff0c;\u65e0\u9700\u624b\u52a8\u5e72\u9884&#xff1a;<\/p>\n<p>sudo systemctl start docker # \u542f\u52a8\u670d\u52a1<br \/>\nsudo systemctl enable docker # \u5f00\u673a\u81ea\u542f<br \/>\nsudo systemctl status docker # \u68c0\u67e5\u72b6\u6001&#xff08;\u5e94\u663e\u793a active (running)&#xff09;<\/p>\n<p>9&#xff09;\u8fd0\u884c Hello World \u955c\u50cf<br \/>\n\u6d4b\u8bd5 Docker \u6838\u5fc3\u529f\u80fd\u662f\u5426\u6b63\u5e38<\/p>\n<p>sudo docker run hello-world<\/p>\n<p>\u8fd0\u884c\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"876\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201145-68892b014fedb.png\" width=\"1400\" \/><\/p>\n<p>10&#xff09;\u914d\u7f6e\u56fd\u5185\u955c\u50cf\u6e90&#xff08;\u52a0\u901f\u62c9\u53d6&#xff09;<\/p>\n<p>\u9ed8\u8ba4\u9700 sudo \u6267\u884c Docker \u547d\u4ee4&#xff0c;\u53ef\u5c06\u5f53\u524d\u7528\u6237\u52a0\u5165 docker \u7ec4<\/p>\n<p>sudo usermod -aG docker $USER # \u5c06\u5f53\u524d\u7528\u6237\u52a0\u5165 docker \u7ec4<br \/>\nnewgrp docker # \u7acb\u5373\u751f\u6548&#xff08;\u6216\u91cd\u65b0\u767b\u5f55\u7ec8\u7aef&#xff09;<\/p>\n<p>\u8fd9\u6837\u547d\u4ee4\u524d\u4e0d\u7528\u52a0sudo\u4e86\u3002<\/p>\n<p>docker run hello-world<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"840\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201146-68892b022ae1c.png\" width=\"1419\" \/>\u00a0\u914d\u7f6e\u56fd\u5185\u955c\u50cf\u52a0\u901f\u62c9\u53d6&#xff1a;<\/p>\n<p>sudo mkdir -p \/etc\/docker<br \/>\nsudo tee \/etc\/docker\/daemon.json &lt;&lt;EOF<br \/>\n{<br \/>\n&#034;registry-mirrors&#034;: [&#034;https:\/\/docker.mirrors.ustc.edu.cn&#034;, &#034;https:\/\/hub-mirror.c.163.com&#034;]<br \/>\n}<br \/>\nEOF<br \/>\nsudo systemctl daemon-reload # \u91cd\u8f7d\u914d\u7f6e<br \/>\nsudo systemctl restart docker # \u91cd\u542f\u670d\u52a1\u751f\u6548<\/p>\n<p>11&#xff09;\u9a8c\u8bc1\u5b89\u88c5&#xff1a;<\/p>\n<p>\u67e5\u770b Docker \u7248\u672c&#xff1a;<\/p>\n<p>docker &#8211;version<\/p>\n<p>\n\u5217\u51fa\u8fd0\u884c\u4e2d\u5bb9\u5668&#xff1a;<\/p>\n<p>docker ps<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"514\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201146-68892b02ded41.png\" width=\"1581\" \/><\/p>\n<h2 style=\"background-color:transparent\">2.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u5b89\u88c5nginx<\/h2>\n<p>1)\u521b\u5efa\u6302\u8f7d\u76ee\u5f55<\/p>\n<p>\u5148\u8bf4\u660eNGINX\u7684\u76ee\u5f55\u7684\u4f5c\u7528&#xff1a;<\/p>\n<p>\/work\/nginx\/conf.d \u7528\u4e8e\u5b58\u653e\u914d\u7f6e\u6587\u4ef6<br \/>\n\/work\/nginx\/html \u7528\u4e8e\u5b58\u653e\u7f51\u9875\u6587\u4ef6<br \/>\n<span style=\"color:#fe2c24\">\/work\/nginx\/logs \u7528\u4e8e\u5b58\u653e\u65e5\u5fd7<\/span><br \/>\n\/work\/nginx\/cert \u7528\u4e8e\u5b58\u653e HTTPS \u8bc1\u4e66<\/p>\n<p>\u6392\u67e5\u9519\u8bef\u65e5\u5fd7\u7684\u65f6\u5019&#xff0c;\u53ef\u4ee5\u5c31\u5230\u8fd9\u4e2awork\/nginx\/logs\u91cc\u9762\u627e\u65e5\u5fd7\u6587\u4ef6\u6392\u67e5\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"654\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201147-68892b03a1b34.png\" width=\"1016\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u5148\u521b\u5efanetwork&#xff0c;\u65b9\u4fbf\u540e\u7eed\u5bb9\u5668\u542f\u52a8\u76f4\u63a5\u52a0\u5165\u3002&#xff08;\u60f3\u8981\u4f7f\u7528\u5bb9\u5668\u540d\u5b57\u4ee3\u66ffip&#xff0c;\u5fc5\u987b\u8ba9docker\u4e2d\u7684\u5bb9\u5668\u5b9e\u4f8b\u90fd\u52a0\u5165\u540c\u4e00\u4e2a\u7f51\u7edc\u3002&#xff09;<\/span><\/p>\n<p>docker network create my-network<\/p>\n<p>\u00a0\u521b\u5efa \/work\/nginx \u76ee\u5f55&#xff0c;\u5e76\u5728\u8be5\u76ee\u5f55\u4e0b\u65b0\u5efa nginx.conf \u6587\u4ef6&#xff0c;\u907f\u514d\u7a0d\u540e\u5b89\u88c5 Nginx \u62a5\u9519\u3002\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>user  nginx;<br \/>\nworker_processes  1;<\/p>\n<p>events {<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>error_log  \/var\/log\/nginx\/error.log warn;<br \/>\npid        \/var\/run\/nginx.pid;<\/p>\n<p>http {<br \/>\n    include       \/etc\/nginx\/mime.types;<br \/>\n    default_type  application\/octet-stream;<br \/>\n    sendfile        on;<br \/>\n    keepalive_timeout  65;<\/p>\n<p>    log_format  main  &#039;$remote_addr &#8211; $remote_user [$time_local] &#034;$request&#034; &#039;<br \/>\n                      &#039;$status $body_bytes_sent &#034;$http_referer&#034; &#039;<br \/>\n                      &#039;&#034;$http_user_agent&#034; &#034;$http_x_forwarded_for&#034;&#039;;<br \/>\n#    access_log  \/var\/log\/nginx\/access.log  main;<\/p>\n<p>    gzip on;<br \/>\n    gzip_min_length 1k;     # \u8bbe\u7f6e\u5141\u8bb8\u538b\u7f29\u7684\u9875\u9762\u6700\u5c0f\u5b57\u8282\u6570<br \/>\n    gzip_buffers 4 16k;     # \u7528\u6765\u5b58\u50a8 gzip \u7684\u538b\u7f29\u7ed3\u679c<br \/>\n    gzip_http_version 1.1;  # \u8bc6\u522b HTTP \u534f\u8bae\u7248\u672c<br \/>\n    gzip_comp_level 2;      # \u8bbe\u7f6e gzip \u7684\u538b\u7f29\u6bd4 1-9\u30021 \u538b\u7f29\u6bd4\u6700\u5c0f\u4f46\u6700\u5feb&#xff0c;\u800c 9 \u76f8\u53cd<br \/>\n    gzip_types text\/plain application\/x-javascript text\/css application\/xml application\/javascript; # \u6307\u5b9a\u538b\u7f29\u7c7b\u578b<br \/>\n    gzip_proxied any;       # \u65e0\u8bba\u540e\u7aef\u670d\u52a1\u5668\u7684 headers \u5934\u8fd4\u56de\u4ec0\u4e48\u4fe1\u606f&#xff0c;\u90fd\u65e0\u6761\u4ef6\u542f\u7528\u538b\u7f29<\/p>\n<p>    include \/etc\/nginx\/conf.d\/*.conf; ## \u52a0\u8f7d\u8be5\u76ee\u5f55\u4e0b\u7684\u5176\u5b83 Nginx \u914d\u7f6e\u6587\u4ef6<br \/>\n}<\/p>\n<p>2&#xff09;\u542f\u52a8nginx<\/p>\n<p>docker run -d &#8211;name nginx &#8211;network my-network &#8211;restart always -p 80:80 -p 443:443 -e &#034;TZ&#061;Asia\/Shanghai&#034; -v \/work\/nginx\/nginx.conf:\/etc\/nginx\/nginx.conf -v \/work\/nginx\/conf.d:\/etc\/nginx\/conf.d -v \/work\/nginx\/logs:\/var\/log\/nginx -v \/work\/nginx\/cert:\/etc\/nginx\/cert -v \/work\/projects\/yudao-ui-admin:\/usr\/share\/nginx\/html <\/p>\n<p>\u6ce8\u610f\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u7684\u00a0-v \/work\/projects\/yudao-ui-admin:\/usr\/share\/nginx\/html\u00a0 \u8fd9\u4e2a\u7684\u610f\u601d\u662f\u628a\u524d\u8005&#xff08;\u76f8\u5f53\u4e8e\u7269\u7406\u5b58\u50a8\u5730\u5740&#xff09;\u6620\u5c04\u5230\u540e\u8005&#xff08;\u8fd0\u884c\u5185\u5b58&#xff09;&#xff0c;\u524d\u8005\u9700\u8981\u662f\u4e0a\u4f20\u7684\u524d\u7aef\u7684\u9879\u76ee\u7684\u6839\u76ee\u5f55&#xff0c;\u540e\u8005\u9700\u8981\u662fnginx\u7684\u914d\u7f6e\u91cc\u9762\u524d\u7aef\u914d\u7f6e\u7684\u5730\u5740&#xff0c;\u8fd9\u6837NGINX\u5728\u52a0\u8f7d\u524d\u7aef\u7684\u8d44\u6e90\u7684\u4e4b\u540e&#xff0c;\u4f1a\u5148\u627e\u5230\/usr\/share\/nginx\/html&#xff0c;\u7136\u540e\u6839\u636e\u8fd9\u4e2a\u6620\u5c04\u627e\u5230\/work\/projects\/yudao-ui-admin&#xff0c;\u5047\u5982\u6211\u4eec\u5c31\u628a\u524d\u7aef\u7684\u8d44\u6e90\u653e\u5728\u8fd9\u4e2a\/work\/projects\/yudao-ui-admin\u76ee\u5f55\u4e0b&#xff0c;\u90a3\u4e48\u5c31\u4f1a\u6210\u529f\u627e\u5230&#xff0c;\u52a0\u8f7d\u524d\u7aef\u8d44\u6e90\u4e86\u3002\u6240\u4ee5\u5b9e\u9645\u5730\u5740\u9700\u8981\u4f60\u6839\u636e\u4f60\u4e0a\u4f20\u7684\u524d\u7aef\u9879\u76ee\u5730\u5740\u6765\u914d\u7f6e\u3002\u540e\u9762\u90e8\u7f72\u524d\u7aef\u7684\u65f6\u5019\u6211\u4eec\u4f1a\u518d\u6b21\u63d0\u5230\u8fd9\u70b9\u3002<\/p>\n<p>3&#xff09;\u6267\u884c docker ps \u547d\u4ee4&#xff0c;\u67e5\u770b\u5230 Nginx \u5bb9\u5668\u7684\u72b6\u6001\u662f UP \u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"417\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201148-68892b0417fe5.png\" width=\"1609\" \/><\/p>\n<\/p>\n<p>\u00a0<\/p>\n<h2>3.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u5b89\u88c5redis<\/h2>\n<p>redis\u5b89\u88c5\u6bd4\u8f83\u7b80\u5355&#xff1a;<\/p>\n<p>docker run -d &#8211;name redis-server &#8211;network my-network   &#8211;restart&#061;always -p 6379:6379 m.daocloud.io\/docker.io\/redis<\/p>\n<p>\u6ce8\u610f\u8fd9\u4e2a&#8211;name \u540e\u9762\u7684redis-server\u5c31\u662f\u542f\u52a8\u7684redis\u5bb9\u5668\u7684\u540d\u5b57&#xff0c;\u6240\u4ee5\u540e\u7aef\u5728\u6253\u5305\u7684\u65f6\u5019&#xff0c;\u5728yml\u914d\u7f6e\u4e2d&#xff0c;redis\u8981\u5199\u8fd9\u4e2aredis-server&#xff0c;\u4e0d\u662flocalhost\u4e5f\u4e0d\u662fip\u5730\u5740\u3002\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"372\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201148-68892b04731ab.png\" width=\"1345\" \/><\/p>\n<p>\u00a0<\/p>\n<h2>4.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u5b89\u88c5mysql<\/h2>\n<p>1.\u5148\u521b\u5efasql\u76ee\u5f55&#xff0c;\u7136\u540e\u628a\u672c\u5730\u7684\u9700\u8981\u521d\u59cb\u5316\u6570\u636e\u5e93\u7684sql\u6587\u4ef6\u4e0a\u4f20\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff0c;\u53ef\u4ee5\u4f7f\u7528scp\u3002<\/p>\n<p>mkdir \/home\/sql<br \/>\nscp C:\/local\/test.sql user&#064;192.1.1.80:\/home\/sql<\/p>\n<p>\u6ce8\u610f\u7b2c\u4e00\u4e2a\u521b\u5efa\u76ee\u5f55\u662f\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u64cd\u4f5c\u3002\u7b2c\u4e8c\u4e2a\u547d\u4ee4\u662f\u5728\u672c\u5730windows\u7cfb\u7edf\u4e0a\u9762&#xff0c;\u6253\u5f00powershell\u64cd\u4f5c\u3002\u628a\u672c\u5730\u7684sql\u6587\u4ef6\u4e0a\u4f20\u5230\u670d\u52a1\u5668&#xff0c;user&#064;ip\u5730\u5740\u9700\u8981\u6362\u6210\u81ea\u5df1\u670d\u52a1\u5668\u7684\u771f\u5b9e\u7684user&#xff08;\u6bd4\u5982root&#xff09;\u548c\u8fdc\u7a0b\u670d\u52a1\u5668\u7684ip\u5730\u5740\u3002<\/p>\n<p>2.\u542f\u52a8mysql<\/p>\n<p>docker run -v \/work\/mysql\/:\/var\/lib\/mysql -v \/home\/sql\/test.sql:\/docker-entrypoint-initdb.d\/init.sql -p 3306:3306 -e MYSQL_ROOT_PASSWORD&#061;123456 &#8211;restart&#061;always &#8211;name mysql &#8211;network my-network -d m.daocloud.io\/docker.io\/mysql<\/p>\n<p>\u00a0\u6ce8\u610f\u4e0a\u9762\u547d\u4ee4\/home\/sql\/test.sql\u8981\u6362\u6210\u81ea\u5df1\u7684\u5b9e\u9645\u7684sql\u6587\u4ef6\u5730\u5740\u548csql\u6587\u4ef6\u540d\u5b57&#xff0c;&#8211;name \u540e\u9762\u7684mysql\u662f\u5bb9\u5668\u542f\u52a8\u7684\u540d\u5b57&#xff0c;\u8fd9\u6837\u7684\u8bdd&#xff0c;\u5c31\u9700\u8981\u540e\u7aef\u7684yml\u914d\u7f6e\u4e2d&#xff0c;\u628amysql\u7684\u5730\u5740ip\u6539\u4e3amysql\u8fd9\u4e2a\u540d\u5b57\u3002\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"239\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201148-68892b04ab87e.png\" width=\"1925\" \/><\/p>\n<p>\u542f\u52a8\u6210\u529f\u540e\u53ef\u4ee5\u53c2\u8003\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\u662f\u5426\u521b\u5efa\u6570\u636e\u5e93\u6210\u529f\u4ee5\u53ca\u6570\u636e\u662f\u5426\u521d\u59cb\u5316&#xff1a;<\/p>\n<p>\u67e5\u770bmysql\u7684\u6570\u636e<br \/>\ndocker exec -it mysql bash<br \/>\nmysql -u root -p<br \/>\n&#8212; \u67e5\u770b\u6240\u6709\u6570\u636e\u5e93<br \/>\nSHOW DATABASES;<\/p>\n<p>&#8212; \u4f7f\u7528\u6307\u5b9a\u6570\u636e\u5e93&#xff08;\u4f8b\u5982 ruoyi-vue-pro&#xff09;<br \/>\nUSE ruoyi-vue-pro;<\/p>\n<p>&#8212; \u67e5\u770b\u6570\u636e\u5e93\u4e2d\u7684\u8868<br \/>\nSHOW TABLES;<\/p>\n<p>&#8212; \u67e5\u770b\u8868\u7ed3\u6784<br \/>\nDESCRIBE \u8868\u540d;<\/p>\n<p>&#8212; \u67e5\u8be2\u8868\u4e2d\u7684\u6570\u636e&#xff08;\u793a\u4f8b&#xff1a;\u67e5\u8be2\u7528\u6237\u8868&#xff09;<br \/>\nSELECT * FROM sys_user LIMIT 10;<br \/>\n\u9000\u51fa&#xff1a;<br \/>\nexit&#xff1b;<br \/>\nexit&#xff1b;<\/p>\n<p>\u00a0<\/p>\n<h2>5.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u90e8\u7f72\u540e\u7aef<\/h2>\n<p>1.\u5982\u524d\u9762\u6240\u8bf4&#xff0c;\u9700\u8981\u9879\u76ee\u73b0\u5728\u672c\u5730\u8fd0\u884c\u6210\u529f&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u6b63\u5e38\u6253\u5305\u3002yml\u914d\u7f6e\u4e2d&#xff0c;redis\u548cmysql\u9700\u8981\u5728\u5bf9\u5e94\u7684yml\u6587\u4ef6&#xff08;\u6bd4\u5982dev.yml&#xff09;\u6539\u6210\u4f60\u5728\u8fdc\u7a0bdocker\u91cc\u9762\u542f\u52a8\u65f6\u7684\u5b9e\u4f8b\u7684\u540d\u79f0\u800c\u4e0d\u662fip\u5730\u5740\u3002<\/p>\n<p>\u6253\u5305\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>mvn clean package &#039;-Dmaven.test.skip&#061;true&#039; -Pdev #\u5982\u679c\u662f\u6253\u5305dev\u73af\u5883<br \/>\nmvn clean package &#039;-Dmaven.test.skip&#061;true&#039; -Pprod #\u5982\u679c\u662f\u6253\u5305prod\u73af\u5883<br \/>\nmvn clean package &#039;-Dmaven.test.skip&#061;true&#039; -Plocal #\u5982\u679c\u662f\u6253\u5305local\u73af\u5883<\/p>\n<p>2.\u4e0a\u4f20\u6253\u5305\u597d\u7684jar\u5305\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u5b9e\u4f8b<\/p>\n<p>\u5148\u5728linux\u670d\u52a1\u5668\u521b\u5efajar\u5305\u76ee\u5f55<\/p>\n<p>mkdir &#8211;parents \/work\/projects\/yudao-server<\/p>\n<p>\u5229\u7528scp\u4e0a\u4f20\u672c\u5730jar\u5305\u5230\u65b0\u5efa\u7684\u8fdc\u7a0b\u76ee\u5f55\u00a0<\/p>\n<p>\u5728\u672c\u5730\u7684windows\u7cfb\u7edf\u6253\u5f00powershell \u8fd0\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<p>scp D:\\\\softs\\\\ruoyi-vue-pro\\\\yudao-server\\\\target\\\\yudao-server.jar root&#064;13.84.296.124:\/work\/projects\/yudao-server<\/p>\n<p>\u6ce8\u610f\u4e0a\u8ff0\u547d\u4ee4\u4e2d&#xff0c;jar\u5305\u5730\u5740\u4e3a\u591a\u6a21\u5757\u9879\u76ee\u4e2d&#xff0c;\u5305\u542b\u542f\u52a8\u7c7b\u7684\u4e3b\u6a21\u5757\u7684jar\u5305\u7684\u5730\u5740\u3002root&#064;ip\u9700\u8981\u66ff\u6362\u6210\u81ea\u5df1\u7684\u771f\u5b9e\u7684\u89d2\u8272\u548c\u8fdc\u7a0b\u670d\u52a1\u5668\u5b9e\u4f8b\u7684ip\u3002<\/p>\n<p>3.\u5728 \/work\/projects\/yudao-server \u76ee\u5f55\u4e0b&#xff0c;\u65b0\u5efa Dockerfile \u6587\u4ef6<br \/>\n\u5148\u786e\u4fdd\u5df2\u8fdb\u5165 \/work\/projects\/yudao-server \u76ee\u5f55<\/p>\n<p>cd \/work\/projects\/yudao-server\u00a0<\/p>\n<p>\u4f7f\u7528 vim \u65b0\u5efa\u5e76\u7f16\u8f91 Dockerfile<\/p>\n<p>vim Dockerfile<\/p>\n<p>\u00a0\u6309 i \u952e\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f&#xff0c;\u8f93\u5165 Dockerfile \u5185\u5bb9&#xff08;\u6bd4\u5982\u57fa\u4e8e Java \u9879\u76ee\u7684\u6a21\u677f&#xff0c;\u53ef\u53c2\u8003\u4f60\u63d0\u4f9b\u7684\u8d44\u6599\u6309\u9700\u4fee\u6539 &#xff09;&#xff1a;<\/p>\n<p>## AdoptOpenJDK \u505c\u6b62\u53d1\u5e03 OpenJDK \u4e8c\u8fdb\u5236&#xff0c;\u800c Eclipse Temurin \u662f\u5b83\u7684\u5ef6\u4f38&#xff0c;\u63d0\u4f9b\u66f4\u597d\u7684\u7a33\u5b9a\u6027<br \/>\n## \u611f\u8c22\u590d\u65e6\u6838\u535a\u58eb\u7684\u5efa\u8bae&#xff01;\u7070\u5b50\u54e5&#xff0c;\u725b\u76ae&#xff01;<br \/>\nFROM m.daocloud.io\/docker.io\/eclipse-temurin:8-jre<\/p>\n<p>## \u521b\u5efa\u76ee\u5f55&#xff0c;\u5e76\u4f7f\u7528\u5b83\u4f5c\u4e3a\u5de5\u4f5c\u76ee\u5f55<br \/>\nRUN mkdir -p \/yudao-server<br \/>\nWORKDIR \/yudao-server<br \/>\n## \u5c06\u540e\u7aef\u9879\u76ee\u7684 Jar \u6587\u4ef6&#xff0c;\u590d\u5236\u5230\u955c\u50cf\u4e2d<br \/>\nCOPY yudao-server.jar app.jar<\/p>\n<p>## \u8bbe\u7f6e TZ \u65f6\u533a<br \/>\n## \u8bbe\u7f6e JAVA_OPTS \u73af\u5883\u53d8\u91cf&#xff0c;\u53ef\u901a\u8fc7 docker run -e &#034;JAVA_OPTS&#061;&#034; \u8fdb\u884c\u8986\u76d6<br \/>\nENV TZ&#061;Asia\/Shanghai JAVA_OPTS&#061;&#034;-Xms512m -Xmx512m&#034;<\/p>\n<p>## \u66b4\u9732\u540e\u7aef\u9879\u76ee\u7684 48080 \u7aef\u53e3<br \/>\nEXPOSE 48080<\/p>\n<p>## \u542f\u52a8\u540e\u7aef\u9879\u76ee<br \/>\nENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd&#061;file:\/dev\/.\/urandom -jar app.jar<\/p>\n<p>\u6309 Esc \u952e&#xff0c;\u8f93\u5165 :wq \u5e76\u56de\u8f66&#xff0c;\u5373\u53ef\u4fdd\u5b58\u521b\u5efa\u597d\u7684 Dockerfile \u6587\u4ef6\u3002<\/p>\n<p>4.\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff0c;\u6784\u5efa\u540d\u5b57\u4e3a yudao-server \u7684 Docker \u955c\u50cf<\/p>\n<p>cd \/work\/projects\/yudao-server<br \/>\ndocker build -t yudao-server .<\/p>\n<p>\u00a0\u6ce8\u610f\u6700\u540e\u9762\u6709\u4e2a .\u00a0<\/p>\n<p>5.\u5728 \/work\/projects\/yudao-server \u76ee\u5f55\u4e0b&#xff0c;\u65b0\u5efa Shell \u811a\u672c deploy.sh&#xff0c;\u4f7f\u7528 Docker \u542f\u52a8\u540e\u7aef\u9879\u76ee\u3002\u7f16\u5199\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\nset -e<\/p>\n<p>###### \u7b2c\u4e00\u6b65&#xff1a;\u5220\u9664\u53ef\u80fd\u542f\u52a8\u7684\u8001 yudao-server \u5bb9\u5668<br \/>\necho &#034;\u5f00\u59cb\u5220\u9664 yudao-server \u5bb9\u5668&#034;<br \/>\ndocker stop yudao-server || true<br \/>\ndocker rm yudao-server || true<br \/>\necho &#034;\u5b8c\u6210\u5220\u9664 yudao-server \u5bb9\u5668&#034;<\/p>\n<p>## \u7b2c\u4e8c\u6b65&#xff1a;\u542f\u52a8\u65b0\u7684 yudao-server \u5bb9\u5668 \\\\<br \/>\necho &#034;\u5f00\u59cb\u542f\u52a8 yudao-server \u5bb9\u5668&#034;<br \/>\ndocker run -d \\\\<br \/>\n&#8211;name yudao-server \\\\<br \/>\n-p 48080:48080 \\\\<br \/>\n&#8211;network my-network \\\\<br \/>\n-e &#034;SPRING_PROFILES_ACTIVE&#061;dev&#034; \\\\<br \/>\n-v \/work\/projects\/yudao-server:\/root\/logs\/ \\\\<br \/>\nyudao-server<br \/>\necho &#034;\u6b63\u5728\u542f\u52a8 yudao-server \u5bb9\u5668\u4e2d&#xff0c;\u9700\u8981\u7b49\u5f85 60 \u79d2\u5de6\u53f3&#034;<\/p>\n<ul>\n<li>\u7528\u65e5\u5fd7\u6587\u4ef6&#xff0c;\u6302\u8f7d\u5230\u670d\u52a1\u5668\u7684\u7684\u00a0\/work\/projects\/yudao-server\u00a0\u76ee\u5f55\u4e0b<\/li>\n<li>\u901a\u8fc7\u00a0SPRING_PROFILES_ACTIVE\u00a0\u8bbe\u7f6e\u4e3a\u00a0dev\u00a0\u5f00\u53d1\u73af\u5883<\/li>\n<\/ul>\n<p>\u00a06.\u542f\u52a8\u540e\u7aef\u9879\u76ee&#xff1a;<\/p>\n<p>\u6267\u884c sh deploy.sh \u547d\u4ee4&#xff0c;\u4f7f\u7528 Docker \u542f\u52a8\u540e\u7aef\u9879\u76ee<\/p>\n<p>chmod &#043;x deploy.sh<br \/>\nsh deploy.sh<\/p>\n<p>\u6267\u884c docker logs yudao-server&#xff0c;\u67e5\u770b\u542f\u52a8\u65e5\u5fd7\u3002<\/p>\n<p>\u6ce8\u610f&#xff0c;\u56e0\u4e3a\u540e\u7aef\u542f\u52a8\u9700\u8981redis\u548cmysql\u5148\u542f\u52a8&#xff0c;\u6240\u4ee5\u8981\u6309\u7167\u987a\u5e8f\u5148\u628aredis\u548cmysql\u90e8\u7f72\u597d&#xff0c;\u5e76\u4e14\u786e\u8ba4\u597d\u542f\u52a8\u547d\u4ee4\u90fd\u5305\u542b\u4e86\u52a0\u5165my-network\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7f51\u7edc\u4e2d\u3002\u00a0<\/p>\n<h2>6.\u8fdc\u7a0blinux\u670d\u52a1\u5668\u90e8\u7f72\u524d\u7aef<\/h2>\n<p>1.\u5148\u4fee\u6539\u524d\u7aef\u7684\u914d\u7f6e\u5730\u5740\u3002\u5047\u5982\u8981\u90e8\u7f72dev&#xff0c;\u5219\u5728.env.dev\u91cc\u9762\u914d\u7f6e\u5730\u5740\u5982\u4e0b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"813\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201148-68892b04f373c.png\" width=\"2411\" \/><\/p>\n<p>\u5982\u4e0a\u56fe\u5c31\u662f\u628abaseUrl\u6539\u4e3a\u8fdc\u7a0blinux\u670d\u52a1\u5668\u5b9e\u4f8b\u7684\u771f\u5b9e\u7684ip\u5730\u5740\u3002\u00a0<\/p>\n<p>2.\u6253\u5305\u524d\u7aef&#xff1a;<\/p>\n<p>npm run build:dev<\/p>\n<p>3.\u628adist\u6587\u4ef6\u4e0a\u4f20\u5230\u8fdc\u7a0b\u7684\u534e\u4e3a\u670d\u52a1\u5668\u5b9e\u4f8b<\/p>\n<p>\u5148\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u521b\u5efa\u76ee\u5f55\/work\/projects\/yudao-ui-admin<\/p>\n<p>mkdir \/work\/projects\/yudao-ui-admin<\/p>\n<p>\u00a0\u628a\u524d\u7aef\u6253\u5305\u597d\u7684dist\u6587\u4ef6\u4e0a\u4f20\u5230\u8fdc\u7a0b\u534e\u4e3a\u670d\u52a1\u5668\u5b9e\u4f8b<\/p>\n<h6>\u683c\u5f0f&#xff1a;scp -r \u672c\u5730dist\u76ee\u5f55 \u7528\u6237\u540d&#064;\u670d\u52a1\u5668IP:\u76ee\u6807\u76ee\u5f55<\/h6>\n<p>scp -r D:\\\\softs\\\\yudao-ui-admin-vue3\\\\dist* root&#064;14.924.20.114:\/work\/projects\/yudao-ui-admin\/<\/p>\n<p>\u6ce8\u610f\u672c\u5730dist\u8def\u5f84\u548c\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u89d2\u8272\u4ee5\u53ca\u5730\u5740\u9700\u8981\u6539\u4e3a\u4f60\u81ea\u5df1\u7684\u54c8\u3002<\/p>\n<p>4.\/work\/nginx\/conf.d \u76ee\u5f55\u4e0b&#xff0c;\u521b\u5efa ruoyi-vue-pro.conf&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>server {<br \/>\n    listen       80;<br \/>\n    server_name  13.29.296.47; ## \u91cd\u8981&#xff01;&#xff01;&#xff01;\u4fee\u6539\u6210\u4f60\u7684\u8fdc\u7a0b\u670d\u52a1\u5668\u5b9e\u4f8b\u771f\u5b9eip\u5730\u5740<\/p>\n<p>    location \/ { ## \u524d\u7aef\u9879\u76ee<br \/>\n        root   \/usr\/share\/nginx\/html;<br \/>\n        index  index.html index.htm;<br \/>\n        try_files $uri $uri\/ \/index.html;<br \/>\n    }<\/p>\n<p>    location \/admin-api\/ { ## \u540e\u7aef\u9879\u76ee &#8211; \u7ba1\u7406\u540e\u53f0<br \/>\n        proxy_pass http:\/\/yudao-server:48080\/admin-api\/; ## \u91cd\u8981&#xff01;&#xff01;&#xff01;proxy_pass \u9700\u8981\u8bbe\u7f6e\u4e3a\u540e\u7aef\u9879\u76ee\u6240\u5728\u670d\u52a1\u5668\u7684 IP<br \/>\n        proxy_set_header Host $http_host;<br \/>\n        proxy_set_header X-Real-IP $remote_addr;<br \/>\n        proxy_set_header REMOTE-HOST $remote_addr;<br \/>\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n    }<\/p>\n<p>    location \/app-api\/ { ## \u540e\u7aef\u9879\u76ee &#8211; \u7528\u6237 App<br \/>\n        proxy_pass http:\/\/yudao-server:48080\/app-api\/; ## \u91cd\u8981&#xff01;&#xff01;&#xff01;proxy_pass \u9700\u8981\u8bbe\u7f6e\u4e3a\u540e\u7aef\u9879\u76ee\u6240\u5728\u670d\u52a1\u5668\u7684 IP<br \/>\n        proxy_set_header Host $http_host;<br \/>\n        proxy_set_header X-Real-IP $remote_addr;<br \/>\n        proxy_set_header REMOTE-HOST $remote_addr;<br \/>\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n    }<\/p>\n<p>}<\/p>\n<p>\u00a0<\/p>\n<p>\u521b\u5efa\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>sudo nano \/work\/nginx\/conf.d\/ruoyi-vue-pro.conf<\/p>\n<p>\u5728\u91cc\u9762\u7c98\u8d34\u4e0a\u4e0a\u9762\u7684\u914d\u7f6e\u4fe1\u606f\u540e&#xff0c;ctrl&#043;o &#xff0c;\u56de\u8f66&#xff0c;ctrl&#043;x&#xff0c;\u5373\u53ef\u3002<\/p>\n<p>\u8bb2\u89e3\u4e0b\u914d\u7f6e\u91cc\u7684\u5185\u5bb9\u3002\u914d\u7f6enginx\u76d1\u542c\u8fdc\u7a0b\u5b9e\u4f8bip\u5730\u5740&#xff0c;\u524d\u7aef\u7684root\u914d\u7f6e\u7684\u662froot \u00a0 \/usr\/share\/nginx\/html&#xff0c;\u800c\u7ed3\u5408\u6211\u4eec\u6700\u524d\u9762\u4e00\u5f00\u59cb\u914d\u7f6e\u7684nginx&#xff0c;\u00a0-v \/work\/projects\/yudao-ui-admin:\/usr\/share\/nginx\/html \u8fd9\u4e2a\u6620\u5c04&#xff0c;\u90a3\u4e48\u6709\u8bbf\u95ee\u524d\u7aef\u5c31\u4f1a\u6620\u5c04\u5230\/work\/projects\/yudao-ui-admin&#xff0c;\u800c\u6211\u4eec\u6253\u5305\u524d\u7aef\u7684\u65f6\u5019&#xff0c;\u521a\u597d\u5c31\u662f\u628a\u672c\u5730\u7684dist\u6587\u4ef6\u91cc\u9762\u7684\u5185\u5bb9\u4e0a\u4f20\u5230\u4e86\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\/work\/projects\/yudao-ui-admin \u8fd9\u4e2a\u76ee\u5f55\u4e0b&#xff0c;\u90a3\u4e48\u5c31\u4f1a\u987a\u5229\u627e\u5230\u4e86\u3002\u800c\u5982\u679cNGINX\u76d1\u542c\u5230\u4e86\u540e\u7aef\u7684\u914d\u7f6e\u89c4\u5219\u6709\u7ea6\u5b9a\u7684admin-api\u548capp-api\u7684\u8bdd&#xff0c;\u5c31\u4f1a\u8fdb\u5165\u540e\u7aef\u9879\u76ee&#xff0c;\u540e\u7aef\u9879\u76ee\u4e2d&#xff0c;proxy_pass http:\/\/yudao-server:48080\/admin-api\/ \u8fd9\u4e2a\u914d\u7f6e\u7684\u8f6c\u53d1\u5730\u5740&#xff0c;\u5176\u4e2dyudao-server&#xff0c;\u5c31\u662f\u6211\u4eec\u5728docker\u91cc\u9762\u90e8\u7f72\u7684\u540e\u7aef\u7684\u5bb9\u5668\u7684\u540d\u5b57\u3002\u8fd9\u6837\u4e0d\u7528\u5199ip&#xff0c;\u5c31\u53ef\u4ee5docker\u5185\u90e8\u901a\u4fe1\u4e86&#xff0c;\u56e0\u4e3a\u90fd\u5df2\u7ecf\u52a0\u5165\u4e86\u81ea\u5b9a\u4e49\u7f51\u7edcmy-network\u3002<\/p>\n<p>5.\u914d\u7f6e\u597d\u540e&#xff0c;\u9700\u8981nginx\u91cd\u65b0\u52a0\u8f7d\u4e0b\u914d\u7f6e\u9879&#xff0c;\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>sudo nano \/work\/nginx\/conf.d\/ruoyi-vue-pro.conf<\/p>\n<p>6.\u8fd9\u6837&#xff0c;\u6574\u4e2a\u9879\u76ee\u5c31\u90e8\u7f72\u6210\u529f\u4e86\u3002&#xff08;\u524d\u7aef\u3001\u540e\u7aef\u3001nginx\u3001redis&#xff0c;mysql&#xff09;<\/p>\n<p>\u00a0\u6211\u4eec\u767b\u5f55\u4e0b\u7cfb\u7edf\u9875\u9762\u5730\u5740&#xff08;\u8f93\u5165\u8fdc\u7a0b\u670d\u52a1\u5668ip\u5730\u5740\u5373\u53ef&#xff09;&#xff0c;\u5982\u4e0b\u8bbf\u95ee\u6210\u529f&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1001\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201150-68892b0650909.png\" width=\"2799\" \/><\/p>\n<p>\u6ce8\u610f&#xff0c;\u5982\u679c\u7aef\u53e3\u8bbf\u95ee\u4e0d\u901a&#xff0c;\u53ef\u80fd\u662f\u7533\u8bf7\u7684\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u7aef\u53e380\u7b49\u6ca1\u6709\u5f00\u653e&#xff0c;\u53ef\u4ee5\u5728\u89c4\u5219\u91cc\u9762\u914d\u7f6e&#xff0c;\u6bd4\u5982\u6211\u4e70\u7684\u67d0\u4e91\u7684\u670d\u52a1\u5668&#xff0c;\u5c31\u662f\u9ed8\u8ba4\u4e0d\u5f00\u653e&#xff0c;\u4e00\u5f00\u59cb\u5bfc\u81f4\u8bbf\u95ee\u4e0d\u901a\u3002<\/p>\n<p>\u540e\u7eed\u5982\u679c\u57df\u540d\u7533\u8bf7\u4e0b\u6765&#xff0c;\u4f1a\u5728\u8fd9\u91cc\u7ee7\u7eed\u8bf4\u4e0b\u6539\u52a8\u70b9&#xff0c;\u91cd\u65b0\u90e8\u7f72\u4e0b\u3002&#xff08;\u65b0\u624b\u5c0f\u767d&#xff0c;\u4ec5\u4f9b\u53c2\u8003&#xff09;<\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb951\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u8bf4\u660e\uff1a\u9879\u76ee\u5148\u5728\u672c\u5730\u542f\u52a8\u6b63\u5e38\uff0c\u7136\u540e\u53ef\u4ee5\u6b63\u5e38\u6253\u5305\u6210jar\u5305\u3002\u65e0\u8bba\u540e\u7aef\u591a\u590d\u6742\u7684\u6a21\u5757\uff0c\u5176\u5b9e\u90e8\u7f72\u7684\u65f6\u5019\u53ea\u9700\u8981\u7528\u5230\u8fd0\u884c\u6a21\u5757\u4e0b\u9762\u7684jar\u5305\u5c31\u884c\u4e86\u3002\u6bd4\u5982\u6211\u7684\u542f\u52a8\u7c7b\u5728B\u6a21\u5757\uff0c\u90a3\u4e48\u5c31\u662f\u9700\u8981B\u6a21\u5757\u4e0b\u7684target\u6587\u4ef6\u91cc\u9762\u7684jar\u6587\u4ef6\u3002\u56e0\u4e3a\u5229\u7528docker\u90e8\u7f72\u5bb9\u5668\uff0c\u800c\u4e14\u6211\u4eec\u914d\u7f6e\u7684\u65f6\u5019\u9009\u62e9\u5bb9\u5668\u540d\u800c\u4e0d\u662fip\u5730\u5740\uff0c\u6240\u4ee5\u521b\u5efa\u7684\u5bb9\u5668\u9700\u8981\u52a0\u5165\u4e00\u4e2a\u76f8\u5f53\u4e8edocker\u5185\u90e8\u7684\u5185\u7f51my-network\uff0c\u8fd9\u6837\u624d\u80fd\u88ab\u8bc6\u522b\uff0c\u4e92\u76f8\u901a\u4fe1\u3002\u8fd8\u6709\u5c31\u662f\u8fdc\u7a0b\u5b9e\u4f8b\u7533\u8bf7\u7684\u57df\u540d\u8fd8\u6ca1\u6709\u5ba1\u6279\u4e0b\u6765\uff0c\u53ea\u80fd\u662f\u5148\u7528\u8fdc\u7a0bip\u6765\u90e8\u7f72\u3002\u540e\u7eed\u7533\u8bf7\u4e0b\u6765\u540e\uff0c\u4f1a\u6539\u4e3a\u57df\u540d\u90e8\u7f72\u3002_adoptopenjdk \u505c\u6b62\u53d1\u5e03 openjdk \u4e8c\u8fdb\u5236<\/p>\n","protected":false},"author":2,"featured_media":46790,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,98,292],"topic":[],"class_list":["post-46799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker","tag-spring-boot","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/46799.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb951\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u8bf4\u660e\uff1a\u9879\u76ee\u5148\u5728\u672c\u5730\u542f\u52a8\u6b63\u5e38\uff0c\u7136\u540e\u53ef\u4ee5\u6b63\u5e38\u6253\u5305\u6210jar\u5305\u3002\u65e0\u8bba\u540e\u7aef\u591a\u590d\u6742\u7684\u6a21\u5757\uff0c\u5176\u5b9e\u90e8\u7f72\u7684\u65f6\u5019\u53ea\u9700\u8981\u7528\u5230\u8fd0\u884c\u6a21\u5757\u4e0b\u9762\u7684jar\u5305\u5c31\u884c\u4e86\u3002\u6bd4\u5982\u6211\u7684\u542f\u52a8\u7c7b\u5728B\u6a21\u5757\uff0c\u90a3\u4e48\u5c31\u662f\u9700\u8981B\u6a21\u5757\u4e0b\u7684target\u6587\u4ef6\u91cc\u9762\u7684jar\u6587\u4ef6\u3002\u56e0\u4e3a\u5229\u7528docker\u90e8\u7f72\u5bb9\u5668\uff0c\u800c\u4e14\u6211\u4eec\u914d\u7f6e\u7684\u65f6\u5019\u9009\u62e9\u5bb9\u5668\u540d\u800c\u4e0d\u662fip\u5730\u5740\uff0c\u6240\u4ee5\u521b\u5efa\u7684\u5bb9\u5668\u9700\u8981\u52a0\u5165\u4e00\u4e2a\u76f8\u5f53\u4e8edocker\u5185\u90e8\u7684\u5185\u7f51my-network\uff0c\u8fd9\u6837\u624d\u80fd\u88ab\u8bc6\u522b\uff0c\u4e92\u76f8\u901a\u4fe1\u3002\u8fd8\u6709\u5c31\u662f\u8fdc\u7a0b\u5b9e\u4f8b\u7533\u8bf7\u7684\u57df\u540d\u8fd8\u6ca1\u6709\u5ba1\u6279\u4e0b\u6765\uff0c\u53ea\u80fd\u662f\u5148\u7528\u8fdc\u7a0bip\u6765\u90e8\u7f72\u3002\u540e\u7eed\u7533\u8bf7\u4e0b\u6765\u540e\uff0c\u4f1a\u6539\u4e3a\u57df\u540d\u90e8\u7f72\u3002_adoptopenjdk \u505c\u6b62\u53d1\u5e03 openjdk \u4e8c\u8fdb\u5236\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/46799.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-29T20:11:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201145-68892b014fedb.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46799.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/46799.html\",\"name\":\"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-29T20:11:52+00:00\",\"dateModified\":\"2025-07-29T20:11:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/46799.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/46799.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/46799.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/46799.html","og_locale":"zh_CN","og_type":"article","og_title":"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb951\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u8bf4\u660e\uff1a\u9879\u76ee\u5148\u5728\u672c\u5730\u542f\u52a8\u6b63\u5e38\uff0c\u7136\u540e\u53ef\u4ee5\u6b63\u5e38\u6253\u5305\u6210jar\u5305\u3002\u65e0\u8bba\u540e\u7aef\u591a\u590d\u6742\u7684\u6a21\u5757\uff0c\u5176\u5b9e\u90e8\u7f72\u7684\u65f6\u5019\u53ea\u9700\u8981\u7528\u5230\u8fd0\u884c\u6a21\u5757\u4e0b\u9762\u7684jar\u5305\u5c31\u884c\u4e86\u3002\u6bd4\u5982\u6211\u7684\u542f\u52a8\u7c7b\u5728B\u6a21\u5757\uff0c\u90a3\u4e48\u5c31\u662f\u9700\u8981B\u6a21\u5757\u4e0b\u7684target\u6587\u4ef6\u91cc\u9762\u7684jar\u6587\u4ef6\u3002\u56e0\u4e3a\u5229\u7528docker\u90e8\u7f72\u5bb9\u5668\uff0c\u800c\u4e14\u6211\u4eec\u914d\u7f6e\u7684\u65f6\u5019\u9009\u62e9\u5bb9\u5668\u540d\u800c\u4e0d\u662fip\u5730\u5740\uff0c\u6240\u4ee5\u521b\u5efa\u7684\u5bb9\u5668\u9700\u8981\u52a0\u5165\u4e00\u4e2a\u76f8\u5f53\u4e8edocker\u5185\u90e8\u7684\u5185\u7f51my-network\uff0c\u8fd9\u6837\u624d\u80fd\u88ab\u8bc6\u522b\uff0c\u4e92\u76f8\u901a\u4fe1\u3002\u8fd8\u6709\u5c31\u662f\u8fdc\u7a0b\u5b9e\u4f8b\u7533\u8bf7\u7684\u57df\u540d\u8fd8\u6ca1\u6709\u5ba1\u6279\u4e0b\u6765\uff0c\u53ea\u80fd\u662f\u5148\u7528\u8fdc\u7a0bip\u6765\u90e8\u7f72\u3002\u540e\u7eed\u7533\u8bf7\u4e0b\u6765\u540e\uff0c\u4f1a\u6539\u4e3a\u57df\u540d\u90e8\u7f72\u3002_adoptopenjdk \u505c\u6b62\u53d1\u5e03 openjdk \u4e8c\u8fdb\u5236","og_url":"https:\/\/www.wsisp.com\/helps\/46799.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-29T20:11:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250729201145-68892b014fedb.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/46799.html","url":"https:\/\/www.wsisp.com\/helps\/46799.html","name":"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-29T20:11:52+00:00","dateModified":"2025-07-29T20:11:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/46799.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/46799.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/46799.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u591a\u6a21\u5757\uff0c\u6a21\u5757\u4e2d\u5d4c\u5957\u7684SpringBoot\u9879\u76ee\uff0c\u8fdc\u7a0b\u90e8\u7f72\u5230\u670d\u52a1\u5668\u5b9e\u4f8b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=46799"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/46799\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/46790"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=46799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=46799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=46799"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=46799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}