<font face="arial" size="2"><p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Hi Marc,</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Really helpful!</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">You're the best.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Lloyd</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">-----Original Message-----<br />From: "'Marc Worrell' via Zotonic developers" <zotonic-developers@googlegroups.com><br />Sent: Tuesday, January 15, 2019 3:39am<br />To: "'Marc Worrell' via Zotonic developers" <zotonic-developers@googlegroups.com><br />Cc: "erlang-questions@erlang.org" <erlang-questions@erlang.org><br />Subject: Re: [Zotonic-Dev] zotonic CI deployment best practice for 2019<br /><br /></p>
<div id="SafeStyles1547576499">Hi Lloyd (and rest of list),
<div class="">For Zotonic I have seen two setups:</div>
<div class="">1. Only Zotonic (Erlang)  (single machine)</div>
<div class="">With this setup external port 80 is redirected (using iptables prerouting rules) to 127.0.0.1:8000.</div>
<div class="">And port 443 to 8433. Erlang is directly handling all (SSL) traffic.</div>
<div class="">Same is done with the SMTP port 25, which is usually mapped to 2525.</div>
<div class="">2. Using a proxy (one or more machines)</div>
<div class="">In this haproxy or nginx are used to terminate the SSL connections and proxy requests to Zotonic/Erlang.</div>
<div class="">The Zotonic node is either running locally or on some other host in local network.</div>
<div class="">In this setup it is also common to have a mail server running to forward incoming email to the Zotonic/Erlang node.</div>
<div class="">Setup 1 (direct) is the easiest for small single-server operations.</div>
<div class="">Setup 2 (proxy) is when you want to have multiple machines and a local network.</div>
<div class="">We have setup 1 running on a €50/month VPS, handling monthly traffic of 1.5+ TB (~2M monthly visitors).</div>
<div class="">Another company is running setup 1 on dedicated hardware with more than 1M hourly requests.</div>
<div class="">(That server is mostly idle…)</div>
<div class="">So for most (98%?) sites the simple setup is actually very realistic.</div>
<div class="">You just need to be sure that you have a good backup scheme, as it is a single machine.</div>
<div class="">I know of some people that are working on a “lukewarm” failover setup.</div>
<div class="">With the single VPS server solution we didn’t have any significant down time in the last years and</div>
<div class="">usually have 100% monthly uptime (according to pingdom).</div>
<div class="">So, for me, the single server solution works best.</div>
<div class="">Especially with a VPS where the hosting company moves the VPS in case of any hardware problems.</div>
<div class="">Cheers,</div>
<div class="">Marc</div>
<div class="">
<div>
<blockquote class="">
<div class="">On 14 Jan 2019, at 19:47, <a class="" href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a> wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Hi Marc,</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Many thanks for your prompt response.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">This addresses one part of the puzzle. I can't speak for Eddie, but as a total DevOps noob, a big-picture perspective would give me greater comfort as I move into my own deployments.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">I'm guessing that there are different issues if we're considering on-premises vs. cloud deployment, so considering the two hosting scenarios...</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">What are the specific security, scaling, or other issues we need to attend to? And how do we implement them? For instance, if on-premises: Do we need a dmz to protect our LAN or is port-forwarding sufficient? Should we put a proxy server such as nginx or HAProxy in front of our app? How can we most effectively harden our servers and applications against exploits?</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">I understand much of this goes beyond the realm of Zotonic, Erlang, and Nitrogen. But when I step out into the web for answers I'm totally overwhelmed with confusing and oft contradictory info.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">I'd love to create a living-document tutorial and checklist for, at least, the simplest deployments, but wouldn't know where to start.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Thanks again,</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Lloyd</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">-----Original Message-----<br class="" />From: "'Marc Worrell' via Zotonic developers" <<a class="" href="mailto:zotonic-developers@googlegroups.com">zotonic-developers@googlegroups.com</a>><br class="" />Sent: Monday, January 14, 2019 11:53am<br class="" />To: "'Marc Worrell' via Zotonic developers" <<a class="" href="mailto:zotonic-developers@googlegroups.com">zotonic-developers@googlegroups.com</a>><br class="" />Cc: "<a class="" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>" <<a class="" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>><br class="" />Subject: Re: [Zotonic-Dev] zotonic CI deployment best practice for 2019<br class="" /><br class="" /></div>
<div id="SafeStyles1547489469" class="">Hi Eddie and Lloyd,
<div class="">“It depends” is indeed the correct answer...<br class="" />
<div class="">Most Zotonic installations fall in two categories:</div>
<div class="">1. Deployment via a Docker container, which is updated before deployment</div>
<div class="">2. Deployment via git (manual or automatic)</div>
<div class="">Some follow (1),  I follow (2).</div>
<div class="">Nice thing of (2) is that it allows for hot code upgrades and quick turnaround of small patches.</div>
<div class="">When we are i a development cycle for new features we might have 10 to 20 deployments per day.</div>
<div class="">This goes very smooth, we even deploy minor updates to Zotonic and dependencies using hot code upgrades.</div>
<div class="">Zotonic itself can watch changes in the file system and dynamically load new files.</div>
<div class="">
<div class="">Most of the updates we deploy have only minor changes.</div>
</div>
<div class="">Think of changes to templates, css, or translations.</div>
<div class="">And minor Erlang changes (ie. not completely new apps or other dependencies).</div>
<div class="">That is why we can have updates-via-git without service interruption.</div>
<div class="">The orgs that deploy via Docker (option 1) - have typically less frequent updates and perform periodic major updates.</div>
<div class="">As the whole container is updated this also restarts the Zotonic server.</div>
<div class="">Of course it is also possible to deploy using the OTP release mechanism.</div>
<div class="">This is something that will be possible with the 1.0 (really soon now) of Zotonic, as that version is OTP compliant.</div>
<div class="">I personally never had the need to use OTP releases as the version control via git is good enough for us.</div>
<div class="">(Especially with rebar3 managing versions of dependencies.)</div>
<div class="">Cheers, Marc</div>
<div class=""><br class="" />
<div class=""><br class="" />
<blockquote class="">
<div class="">On 14 Jan 2019, at 17:40, <a class="" href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a> wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Hi Eddie,</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">I'm in a similar situation--- planning soon to release a Nitrogen web application but feeling profound apprehension since I don't have a clear understanding of risks and how to minimize them.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">No doubt the flip answer is, "It depends..." Are we talking cloud hosting or on-premises? What are projected traffic patterns? Etc. Etc.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">But "It depends..." doesn't help folks like us who lack experience or organizational support.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">One can find considerable information on the web covering firewalls, proxy servers, load balancers, site hardening, etc. But, like you, I've found little in the Erlang corpus that provides sufficiently clear patterns and guidelines to assuage my Erlang release/production apprehensions.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">It may well be a book-length topic or more, but even a thoughtful, thorough tutorial, or even a checklist, would be helpful.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Please do let me know what you come up with.</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">All the best,</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">Lloyd</div>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<p class="" style="margin:0;padding:0;margin: 0; padding: 0; font-family: arial; font-size: 10pt; overflow-wrap: break-word;"> </p>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">-----Original Message-----<br class="" />From: <a class="" href="mailto:layeddie@gmail.com">layeddie@gmail.com</a><br class="" />Sent: Monday, January 14, 2019 9:28am<br class="" />To: "Zotonic developers" <<a class="" href="mailto:zotonic-developers@googlegroups.com">zotonic-developers@googlegroups.com</a>><br class="" />Subject: [Zotonic-Dev] zotonic CI deployment best practice for 2019<br class="" /><br class="" /></div>
<div id="SafeStyles1547482208" class="">
<div class="" dir="ltr">Hi,
<div class="">I have followed zotonic for the last couple of years and am now interested in setting up a production server for zotonic.</div>
<div class="">I have just spent some time searching zotonic users and zotonic developers for an up to date guide on how you would go about developing and deploying zotonic to a production environment.</div>
<div class="">most of the links I found range from between 2010 - 2012.</div>
<div class="">I have looked through the zotonic documentation as well.</div>
<div class="">I have also installed locally using the zotonic full docker container and the manual install.</div>
<div class="">I am looking for a guide for Git / continuous integration / continuous deployment guide and any best practice tips.</div>
<div class="">Is something like this available?</div>
<div class="">Many thanks</div>
<div class="">Eddie L</div>
<div class="">(Uk based)</div>
</div>
-- <br class="" /><br class="" /> --- <br class="" /> You received this message because you are subscribed to the Google Groups "Zotonic developers" group.<br class="" /> To unsubscribe from this group and stop receiving emails from it, send an email to <a class="" href="mailto:zotonic-developers+unsubscribe@googlegroups.com">zotonic-developers+unsubscribe@googlegroups.com</a>.<br class="" /> For more options, visit <a class="" href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.</div>
-- <br class="" /><br class="" /> --- <br class="" /> You received this message because you are subscribed to the Google Groups "Zotonic developers" group.<br class="" /> To unsubscribe from this group and stop receiving emails from it, send an email to <a class="" href="mailto:zotonic-developers+unsubscribe@googlegroups.com">zotonic-developers+unsubscribe@googlegroups.com</a>.<br class="" /> For more options, visit <a class="" href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.</div>
</blockquote>
</div>
</div>
</div>
</div>
<div class="" style="margin: 0px; padding: 0px; font-family: arial; font-size: 10pt; overflow-wrap: break-word;">-- <br class="" /><br class="" /> --- <br class="" /> You received this message because you are subscribed to the Google Groups "Zotonic developers" group.<br class="" /> To unsubscribe from this group and stop receiving emails from it, send an email to <a class="" href="mailto:zotonic-developers+unsubscribe@googlegroups.com">zotonic-developers+unsubscribe@googlegroups.com</a>.<br class="" /> For more options, visit <a class="" href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.</div>
-- <br class="" /><br class="" /> --- <br class="" /> You received this message because you are subscribed to the Google Groups "Zotonic developers" group.<br class="" /> To unsubscribe from this group and stop receiving emails from it, send an email to <a class="" href="mailto:zotonic-developers+unsubscribe@googlegroups.com">zotonic-developers+unsubscribe@googlegroups.com</a>.<br class="" /> For more options, visit <a class="" href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.</div>
</blockquote>
</div>
</div>
</div>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; overflow-wrap: break-word;">-- <br /><br /> --- <br /> You received this message because you are subscribed to the Google Groups "Zotonic developers" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:zotonic-developers+unsubscribe@googlegroups.com">zotonic-developers+unsubscribe@googlegroups.com</a>.<br /> For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.</p></font>