id: 4327637323864dfdb4539670f2505fb5
parent_id: 
item_type: 1
item_id: 73b3c60e0224467a88c247e8d9a548df
item_updated_time: 1764345639313
title_diff: "[{\"diffs\":[[1,\"在自己的云服务器上部署Shopify App\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":22}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>在自己的云服务器上部署Shopify App</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"45277\\\"></a>\\\r\\\n<h1>在自己的云服务器上部署Shopify App</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"margin:0px;\\\"><div style=\\\"padding:8px 0px;margin:8px auto;max-width:700px;\\\"> <div><span></span></div>\\\n<p></p>\\\n<div style=\\\"--en-blockquote:true;box-sizing: border-box; padding-left: 19px; padding-top: 6px; padding-bottom: 6px; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial; margin-top: 6px\\\"><div>原文链接: <a href=\\\"https://mp.weixin.qq.com/s?__biz=MzI2MjMwMjMyNA==&amp;mid=2247485522&amp;idx=1&amp;sn=2d93e7b26fe1de2c1d0cc56761e83500&amp;chksm=eb8a61b99fcfc245dd6ccb3f03181f92f49b73f7b5f71210cbc4e7d2691f87e51bfa0455f04d&amp;mpshare=1&amp;scene=1&amp;srcid=0731My0nTAopGl0ukIaQme3P&amp;sharer_shareinfo=a427c607319ffa020f86c720068e4f42&amp;sharer_shareinfo_first=a427c607319ffa020f86c720068e4f42#rd\\\"><span>https://mp.weixin.qq.com/s?__biz=MzI2MjMwMjMyNA==&amp;mid=224748...</span></a></div></div>\\\n<p></p>\\\n<div><span></span></div>\\\n<div style=\\\"\\\"><div><div><h1 style=\\\"margin:0\\\"> 在自己的云服务器上部署Shopify App</h1><div><span style=\\\"position:relative\\\">原创</span><span><span style=\\\"position:relative\\\">浅墨 momo</span></span><span><a style=\\\"position:relative\\\"> 浅墨 momo </a></span><span><em></em></span></div><div style=\\\";\\\"><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">前面写过两篇部署Shopify App相关的文章，分别是部署在<a href=\\\"https://mp.weixin.qq.com/s?__biz=MzI2MjMwMjMyNA==&amp;mid=2247485437&amp;idx=1&amp;sn=c53c5de555ebc828a837bd8d57fe4f2e&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">fly.io</a>和<a href=\\\"https://mp.weixin.qq.com/s?__biz=MzI2MjMwMjMyNA==&amp;mid=2247485452&amp;idx=1&amp;sn=b2f89773b2f66b211c60214d9c0cf6be&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">Render</a>上面，这两个都是Shopify官方推荐的第三方托管平台，虽然好用，但是终归是要花钱的。上周我把我们的Shopify App都从Render迁移到自己的云服务器上了，以下是部署流程：</span></p><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">1. 准备项目文件</span></strong></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">首先，将项目代码上传到Ubuntu服务器上，可以使用git clone或者scp等方式，这里我使用git方式，先打开服务器，然后git clone项目代码</span></p><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span># 先cd到想要放置项目代码的目录，然后使用git clone代码</span></span><div><span>git <span>clone</span> &lt;your-git-repository-url&gt;</span></div><div><span><span>cd</span> your_app_dir</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">2. 创建环境变量文件</span></strong></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">项目需要一个.env文件来存储配置。基于Shopify应用需求和Prisma数据库配置，创建.env文件：</span></p><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span>touch</span> .<span>env</span></span></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">编辑.env文件，添加必要的环境变量：</span></p><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span>SHOPIFY_API_KEY</span>=your_app_key</span><div><span><span>SHOPIFY_API_SECRET</span>=your_app_secret</span></div><div><span><span>SHOPIFY_APP_URL</span>=https://your_app_domain</span></div><div><span><span>SCOPES</span>=read_customers,read_themes,write_products</span></div><div><span><span>NODE_ENV</span>=production</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">3. 构建Docker镜像</span></strong></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">使用项目中的Dockerfile构建Docker镜像：</span></p><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span>docker</span> build -t you_app_name .</span></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">4. 运行Docker容器</span></strong></h3><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>docker run -d \\\\</span><div><span>  --name you_app_name \\\\</span></div><div><span>  -p 3000:3000 \\\\</span></div><div><span>  --env-file .<span>env</span> \\\\</span></div><div><span>  -v $(<span>pwd</span>)/prisma:/app/prisma \\\\</span></div><div><span>  you_app_name</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">这个命令会：</span></p><ul style=\\\"margin:0\\\"><li><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">以后台模式运行容器</span></p></li><li><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">将容器的3000端口映射到主机的3000端口</span></p></li><li><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">从.env文件加载环境变量</span></p></li><li><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">将本地prisma目录挂载到容器内的/app/prisma，确保数据库文件持久化</span></p></li></ul><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\"><br/></span></p><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">5. 设置反向代理</span></strong></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">设置Nginx反向代理，在Nginx配置文件中添加以下配置，我的Nginx配置文件的位置是：/etc/nginx/sites-available/default</span></p><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>server {</span><div><span>    <span>listen</span> <span>80</span>;</span></div><div><span>    server_name your-domain.com; <span>//</span> 注意这里的domain必须与上面.env文件中填写的SHOPIFY_APP_URL一致</span></div><div><span>    location / {</span></div><div><span>        proxy_pass         http:<span>//l</span>ocalhost:<span>3000</span>;</span></div><div><span>        proxy_set_header   Host $host;</span></div><div><span>        proxy_set_header   X-Real-IP $remote_addr;</span></div><div><span>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</span></div><div><span>        proxy_set_header   X-Forwarded-Proto $scheme;</span></div><div><span>    }</span></div><div><span>}</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">启用配置并重启Nginx：</span></p><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>sudo ln <span>-</span>s <span>/etc/</span>nginx<span>/sites-available/</span><span>default</span> <span>/etc/</span>nginx<span>/sites-enabled/</span></span><div><span>sudo nginx <span>-</span>t</span></div><div><span>sudo systemctl restart nginx</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">6. 其他Docker容器管理命令</span></strong></h3><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span># 查看正在运行的容器</span></span><div><span>docker <span>ps</span></span></div><div><span><span># 查看容器日志</span></span></div><div><span>docker logs <span>-f</span> you_app_name</span></div><div><span><span># 停止容器</span></span></div><div><span>docker stop you_app_name</span></div><div><span><span># 启动容器</span></span></div><div><span>docker <span>start</span> you_app_name</span></div><div><span><span># 重启容器</span></span></div><div><span>docker restart you_app_name</span></div><div><span><span># 删除容器（如需重建）</span></span></div><div><span>docker <span>rm</span> you_app_name</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><strong><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">7. 设置自动重启</span></strong></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">确保Docker服务配置为开机自启动，并且容器设置为自动重启：</span></p><pre style=\\\"white-space:pre-wrap;\\\"><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span><span># 确保Docker服务开机自启</span></span><div><span>sudo systemctl <span>enable</span> docker</span></div><div><span><span># 使用--restart=always参数重新运行容器</span></span></div><div><span>docker run -d \\\\</span></div><div><span>  --name you_app_name \\\\</span></div><div><span>  -p 3000:3000 \\\\</span></div><div><span>  --env-file .<span>env</span> \\\\</span></div><div><span>  -v $(<span>pwd</span>)/prisma:/app/prisma \\\\</span></div><div><span>  --restart=always \\\\</span></div><div><span>  you_app_name</span></div></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">8. 配置Partner后台App的url</span></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">这个步骤和前面的fly.io和Render部署类似，进入Shopify Partner后台，然后进入App的Configuration页面，将前面步骤中的SHOPIFY_APP_URL的值（https://your_app_domain）填入到以下地方</span></p><div><img src=\\\":/8fc15063f5d84c729997ac3da1fa9d3c\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;\\\"/></div><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">然后进入App Overview页面，点击Select store，选择一个商店安装App来预览我们部署的App</span></p><div style=\\\"padding: 0.5em;\\\"><img src=\\\":/93673516298f4f0785be6e66ace9336e\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;border-radius: 6px;box-shadow: rgb(210, 210, 210) 0px 0px 0.5em 0px;\\\"/></div><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">接下来就可以在商店顺利打开我们部署的App了</span></p><div style=\\\"padding: 0.5em;\\\"><img src=\\\":/85535c2b0eae4bc2a0ba06825679e01d\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;border-radius: 3px;box-shadow: rgb(210, 210, 210) 0px 0px 0.5em 0px;\\\"/></div><h3 style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><span style=\\\"font-weight: bold;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">9. 编写docker脚本</span></h3><p style=\\\"margin:0\\\"><span style=\\\"font-size: 15px;letter-spacing: 1px;\\\">从上面的docker启动命令可以看出这个命令还是比较长的，而且每次更新代码后重新部署的时候要先重新编译，然后暂停并移除之前的docker容器，再重新启动新的docker容器，步骤比较繁琐，所以我这里写了一个脚本，每次更新代码之后直接运行脚本就可以直接完成所有的流程，非常方便。</span></p><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><div><pre><div style=\\\"--en-codeblock:true;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span>./docker-build.sh</span></div></pre></div><p style=\\\"margin:0\\\"><span><br/></span></p></div></pre><div style=\\\"padding: 0.5em;\\\"><img src=\\\":/10b64886aa474efe94b74aab586440b3\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;border-radius: 6px;box-shadow: rgb(210, 210, 210) 0px 0px 0.5em 0px;\\\"/></div><div style=\\\"padding: 0.5em;\\\"><img src=\\\":/ebe7c5e310fa4a54ac3be4724f5f3a60\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;border-radius: 3px;box-shadow: rgb(210, 210, 210) 0px 0px 0.5em 0px;\\\"/></div><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\"><br/></span></p><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em;text-align:left\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">关于我：</span></p><blockquote><p style=\\\"margin:0\\\"><span>211本科毕业，自学计算机编程，8年字节等大厂开发经验，裸辞创业，主要方向为跨境电商，结合AI做一些SaaS产品。</span></p><p style=\\\"margin:0\\\"><span><br/></span></p><p style=\\\"margin:0\\\"><span>有些路，只有走过，才知道它通向哪里。创业是一场马拉松，不是短跑。我相信，每一次小小的坚持，每一个微小的改进，都会在未来某个时刻，以另一种方式回报给我，哪怕节奏慢一点，哪怕路上磕磕绊绊，只要不放弃，就已经在离梦想越来越近。</span></p></blockquote><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">我的创业周报：</span></p><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\"><a href=\\\"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzI2MjMwMjMyNA==&amp;action=getalbum&amp;album_id=3960092725818490882&amp;subscene=159&amp;subscene=&amp;scenenote=https%3A%2F%2Fmp.weixin.qq.com%2Fs%2FpgBQmugieyMaGMIxxihuVg&amp;nolastread=1#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">我的创业周报系列文章</a></span></p><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\">Shopify App开发：</span></p><p style=\\\"margin:0;margin-left:8px;margin-right:8px;line-height:1.75em\\\"><span style=\\\"font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\"><a href=\\\"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzI2MjMwMjMyNA==&amp;action=getalbum&amp;album_id=4013887858934087686#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">Shopify App开发系列</a></span></p><p style=\\\"margin:0;text-align:center\\\"><span style=\\\"text-align: center;font-size: 17px;color: rgb(140, 178, 90);font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 1px;background-color: rgb(255, 255, 255);\\\"><span style=\\\"font-size: 14px;\\\">欢迎大家点击下方卡片与我交流关于创业、职场的一切~</span></span></p><div><span></span></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":30987}]"
metadata_diff: {"new":{"id":"73b3c60e0224467a88c247e8d9a548df","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348845025,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:04:13.636Z
created_time: 2025-11-28T21:04:13.636Z
type_: 13