<ul>
<li>Do you use docker?</li>
<li>Do you upload/update them manually?</li>
<li>Do you include them in the binary and if yes how?</li>
<li>Some other way? (please describe)</li>
</ul>
<hr/>**评论:**<br/><br/>Sphax: <pre><p>I deploy either deb packages at work or docker images. If you don't have a ton of data then I think embedding is fine.</p></pre>UnknownTed: <pre><ol>
<li>only for companies</li>
<li>yes</li>
<li>yes, <a href="https://github.com/UnnoTed/fileb0x" rel="nofollow">https://github.com/UnnoTed/fileb0x</a></li>
<li>you could host a zip file and (download -> unzip) it before initiating your server or you can unzip it after initiating the server with a virtual filesystem (the same way that fileb0x does) <a href="https://godoc.org/golang.org/x/net/webdav#FileSystem" rel="nofollow">https://godoc.org/golang.org/x/net/webdav#FileSystem</a>, so you can write files like you would normally do but in the memory instead</li>
</ol></pre>donatj: <pre><p>I've used go-bindata a few times, it does the job of embedding things well enough. I wish there was an official method in the language.</p></pre>prvst: <pre><p>go-bindata also works for me, from simple text files to third-party binaries</p></pre>buckhx: <pre><p>If it's just a bit of config I use a go:generate and a script</p></pre>ChristophBerger: <pre><p>For item #2 (manual upload) I currently use git push and a git post-receive hook on the server.</p>
<p>For any larger project I would certainly consider docker. (Disclaimer: I have no production-level experience with any of the container ecosystems. I once deployed a Caddy container to RancherOS on Vultr but that was my only serious Docker test so far.)</p></pre>mgutz: <pre><p>App reads an environment variable for assets dir and reads file relative to it. This provides flexibility across our test, staging and production environments.</p>
<pre><code>ASSETS_DIR=/opt/public ourapp
</code></pre>
<p>We simply tar all assets and use scp. That is all automated with ansible.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传