wekan http://tech.oeru.org/ en Docker Compose: A better way to deploy Rocketchat, Wekan, and MongoDB http://tech.oeru.org/docker-compose-better-way-deploy-rocketchat-wekan-and-mongodb <span class="field field--name-title field--type-string field--label-hidden">Docker Compose: A better way to deploy Rocketchat, Wekan, and MongoDB</span> <div class="field field-node--field-blog-tags field-name-field-blog-tags field-type-entity-reference field-label-above"> <h3 class="field__label">Blog tags</h3> <div class="field__items"> <div class="field__item field__item--docker-compose"> <span class="field__item-wrapper"><a href="/taxonomy/term/49" hreflang="en">docker-compose</a></span> </div> <div class="field__item field__item--rocketchat"> <span class="field__item-wrapper"><a href="/taxonomy/term/18" hreflang="en">rocket.chat</a></span> </div> <div class="field__item field__item--wekan"> <span class="field__item-wrapper"><a href="/taxonomy/term/15" hreflang="en">wekan</a></span> </div> <div class="field__item field__item--ubuntu-linux"> <span class="field__item-wrapper"><a href="/taxonomy/term/12" hreflang="en">ubuntu linux</a></span> </div> <div class="field__item field__item--_604"> <span class="field__item-wrapper"><a href="/taxonomy/term/27" hreflang="en">16.04</a></span> </div> <div class="field__item field__item--docker"> <span class="field__item-wrapper"><a href="/taxonomy/term/16" hreflang="en">docker</a></span> </div> <div class="field__item field__item--mongodb"> <span class="field__item-wrapper"><a href="/taxonomy/term/14" hreflang="en">mongodb</a></span> </div> <div class="field__item field__item--nginx"> <span class="field__item-wrapper"><a href="/taxonomy/term/30" hreflang="en">nginx</a></span> </div> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/1" class="username">dave</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue 23/05/2017 - 11:03</span> <div class="clearfix text-formatted field field-node--body field-name-body field-type-text-with-summary field-label-hidden"> <div class="field__items"> <div class="field__item"><p>A few months back, I posted instructions on deploying <a href="/installing-rocketchat-docker-ubuntu-linux-1404">Rocket.Chat</a> and <a href="/installing-wekan-docker-ubuntu-linux-1404">Wekan</a> instances (and their mutual dependency, <a href="/installing-mongodb-docker-ubuntu-linux-1404">MongoDB</a>) individually. Since then, I've spent some time with Docker Compose, a set of scripts which help you to define, build, and manage a set of Docker containers. Docker Compose is a thing of beauty. This is the way I now deploy Rocket.Chat, Wekan, and MongoDB together.</p> <h2>Install Docker and Docker Compose</h2> <p>Install <a href="https://docs.docker.com/engine/installation/linux/ubuntu/">Docker</a> (including the "<a href="https://docs.docker.com/engine/installation/linux/linux-postinstall/">post-installation</a>" steps to allow non-root users to run Docker) and <a href="https://docs.docker.com/compose/install/#alternative-install-options" title="We recommend the &quot;pip&quot; install method">Docker Compose</a> on your server (we recommend Ubuntu 16.04 or the older 14.04). We recommend using the "pip" (Python package manager) to do the install.</p> <h2>Create your Docker Compose recipe</h2> <p>We recommend creating a directory with an obvious name - in my case, it's <code>/home/www/docker-rocketchat-wekan-mongo</code></p> <p>In that directory, I create a file called <code>docker-compose.yml</code> containing (I've removed implementation specific details and replaced them with [placeholders]):</p> <p><code>version: '2'<br /> services:<br />   mongo:<br />     restart: unless-stopped<br />     image: mongo<br />     volumes:<br />       - [data directory path]:/data/db<br />       - [backup directory path]:/backups<br />     command: --smallfiles<br />   rocketchat-oeru:<br />     restart: unless-stopped<br />     image: rocketchat/rocket.chat<br />     ports:<br />       - "127.0.0.1:[port number]:3000" # should be a free port above 1024<br />     depends_on:<br />       - mongo<br />     environment:<br />       - MONGO_URL=mongodb://mongo/rocket<br />       - ROOT_URL=[domain name (including schema, e.g. http://)]<br />     volumes:<br />       - [upload directory path]:/var/www/rocket.chat/uploads<br />   wekan:<br />     restart: unless-stopped<br />     image: mquandalle/wekan<br />     ports:<br />       - "127.0.0.1:[port number]:80" # should be a free port above 1024<br />     depends_on:<br />       - mongo<br />     environment:<br />       - VIRTUAL_HOST=[domain name (don't include schema, e.g. https://)]<br />       - MONGO_URL=mongodb://mongo/plan<br />       - ROOT_URL=[domain name (include schema, e.g. https://)]<br />       - MAIL_URL=smtp://[smtp username]:[smtp password]@[server name or IP]:[port: 25, 465, or 587]/<br />     volumes:<br />       - [path to public content]:/built_app/programs/web.browser/app</code></p> <p>Note, you can include multiple instances of either Rocket.Chat or Wekan simply by providing a new name (e.g. rocketchat2 or wekan2 or similar) and a new set of properties - just make sure you're using a unique (and otherwise unused) port number! You can check what's on your server's ports using <code>netstat -punta | less </code>to make sure you're not doubling up. </p> <p>In case it's not obvious, you can leave out either the rocketchat or wekan definitions if you don't want to run those services!</p> <h2>Creating and Running the Docker Containers</h2> <p>It's easy to create the containers: simply run</p> <p><code>docker pull mongo<br /> docker pull rocket.chat<br /> docker pull mquandalle/wekan</code></p> <p>and when it's finished, run</p> <p><code>docker-compose up </code></p> <p>which should start all your containers, but leave you with a running log - this is great for testing, but when you're happy it's all running you hit CTRL-C (to shut down the current set of containers) and then run</p> <p><code>docker-compose up -d </code></p> <p>which runs the containers in daemon mode, without the running log. You can then log out of your server, and your containers will continue running!</p> <p>Based on the configuration above (the "unless-stopped" directive), your containers will restart automatically if your server is rebooted. If you <em>do</em> want to stop them for some reason, you can via</p> <p><code>docker-compose stop</code></p> <p>Easy.</p> <h2>Serving them to the Web</h2> <p>Once you've got your containers running, you need to make sure you've got a web server running on your host to act as the reverse proxy so that external requests get sent to them reliably! We use <a href="nginx.org">Nginx</a>.</p> <h3>RocketChat Nginx</h3> <p>Here's our configuration (with appropriate [substitutions]) - you can create it as <code>/etc/nginx/sites-available/[domain name]</code>:</p> <p><code>server {<br />     listen 80;<br />     server_name [domain name];</code></p> <p><code>  ## Access and error logs.<br />   access_log /var/log/nginx/[domain name]_access.log;<br />   error_log /var/log/nginx/[domain name]_error.log;</code></p> <p><code>  # see https://tech.oeru.org/protecting-your-users-lets-encrypt-ssl-certs<br />   include /etc/nginx/includes/letsencrypt.conf</code></p> <p><code>  # we use a 302 temporary redirect rather than a 301 permanent redir</code><br /><code>  location / {<br />     return 302 https://[domain name]$request_uri;<br />   }<br /> }<br /><br /> server {<br />     listen 443 ssl;<br />     ssl on;</code><br />      <code>  # see https://tech.oeru.org/protecting-your-users-lets-encrypt-ssl-certs<br />     ssl_certificate /etc/letsencrypt/live/[domain name]/fullchain.pem;<br />     ssl_certificate_key /etc/letsencrypt/live/[domain name]/privkey.pem;<br />     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br />     ssl_dhparam /etc/ssl/certs/dhparam.pem;</code></p> <p><code>    keepalive_timeout 20s;</code></p> <p><code>    root /var/www/html;<br />     index index.html index.htm;</code></p> <p><code>    server_name [domain name];</code></p> <p><code>    ## Access and error logs.<br />     access_log /var/log/nginx/[domain name]_access.log;<br />     error_log /var/log/nginx/[domain name]_error.log;</code></p> <p><code>    location / {<br />         proxy_pass http://127.0.0.1:[your rocketchat port];<br />         proxy_http_version 1.1;<br />         proxy_set_header Upgrade $http_upgrade;<br />         proxy_set_header Connection "upgrade";<br />         proxy_set_header Host $http_host;<br />         proxy_set_header X-Forwarded-Host $host;<br />         proxy_set_header X-Real-IP $remote_addr;<br />         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />         proxy_set_header X-Forward-Proto http;<br />         proxy_set_header X-Nginx-Proxy true;<br />         proxy_redirect off;<br />     }<br /> }</code></p> <p> </p> <h3>Wekan Nginx</h3> <p>Here's our configuration (with appropriate [substitutions]) - you can create it as <code>/etc/nginx/sites-available/[domain name]</code>: </p> <p><code># from https://github.com/wekan/wekan/wiki/Install-Wekan-Docker-in-production<br /> upstream websocket {<br />     server 127.0.0.1:[wekan port];<br /> }</code></p> <p><code>map $http_upgrade $connection_upgrade {<br />     default upgrade;<br />     '' close;<br /> }</code><br /><br /><code>server {<br />     listen    80;<br /><br />     root /var/www/html;<br />     index index.html index.htm;</code></p> <p><code>    # Make site accessible from http://localhost/<br />     server_name [domain name];</code></p> <p><code>    access_log /var/log/nginx/[domain name]_access.log;<br />     error_log /var/log/nginx/[domain name]_error.log;</code></p> <p><code>    # see https://tech.oeru.org/protecting-your-users-lets-encrypt-ssl-certs<br />     include /etc/nginx/includes/letsencrypt.conf</code></p> <p><code>    location / {<br />         return 302 https://[domain name]$request_uri; <br />     }<br /> }</code></p> <p><code>server {<br />     listen 443 ssl;<br />     ssl on;</code><br />      <code>  # see https://tech.oeru.org/protecting-your-users-lets-encrypt-ssl-certs<br />     ssl_certificate /etc/letsencrypt/live/[domain name]/fullchain.pem;<br />     ssl_certificate_key /etc/letsencrypt/live/[domain name]/privkey.pem;<br />     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br />     ssl_dhparam /etc/ssl/certs/dhparam.pem;</code></p> <p><code>    keepalive_timeout 20s;</code></p> <p><code>    access_log /var/log/nginx/[domain name]_access.log;<br />     error_log /var/log/nginx/[domain name]_error.log;</code></p> <p><code>    root /var/www/html;<br />     index index.html index.htm;</code></p> <p><code>    server_name [domain name];</code></p> <p><code>    location / {<br />         proxy_read_timeout 300;<br />         proxy_connect_timeout 300;<br />         proxy_redirect off;<br />         proxy_set_header Host $http_host;<br />         proxy_set_header X-Real-IP $remote_addr;<br />         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />         proxy_set_header X-Forwarded-Proto scheme;<br />         proxy_pass http://127.0.0.1:[your wekan port];<br />         proxy_set_header Host $host;<br />     }</code></p> <p><code>    location ~ websocket$ {<br />         proxy_pass http://websocket;<br />         proxy_http_version 1.1;<br />         proxy_set_header Upgrade $http_upgrade;<br />         proxy_set_header Connection $connection_upgrade;<br />     }</code><br /><code>}</code></p> <h3>Enable Nginx Configuration</h3> <p>To make your configurations active, do the following for each of your Nginx configurations:</p> <p><code>cd /etc/nginx/sites-enabled</code></p> <p>Do this for each file:<br /><code>ln -sf ../sites-available/[filename] .</code></p> <p>To check if there are any errors in the files, run</p> <p><code>nginx -t</code></p> <p>If not, you can restart Nginx to incorporate the new configuration files:</p> <p><code>sudo service nginx reload</code></p> <p>You can check for errors in the relevant log files specified in your nginx configurations above in <code>/var/log/nginx/*_error.log</code> or <code>/var/log/nginx/*_access.log</code>.</p> <h2>Protecting your users and reputation with encryption</h2> <p>We encourage you to ensure that these services are made available with full encryption to protect your users' privacy. It's <a href="/protecting-your-users-lets-encrypt-ssl-certs">easy (and no cost) to set up</a>!  The "include" directive in the Nginx configuration files above are examples of this approach.</p> <h2>Upgrades and Backups</h2> <p>We also encourage you to keep your services upgraded. It's easy to do and you'll experience little if any perceptible down time!</p> <p>Simply re-pull the containers and restart them - the updated containers will be launched without loss of data!</p> <p><code>docker pull mongo<br /> docker pull rocket.chat<br /> docker pull mquandalle/wekan</code></p> <p><code>docker-compose up -d</code></p> <p>If you want to back up your data - you need to do normal file backups of the directories on your local server that you've configured in the <code>docker-compose.yml</code> file, and you can do MongoDB backups based on <a href="/installing-mongodb-docker-ubuntu-linux-1404">our previous article</a> on the topic!</p> </div> </div> </div> <section class="field field-node--field-blog-comments field-name-field-blog-comments field-type-comment field-label-above comment-wrapper"> <a name="comments"></a> <div class="comment-form-wrapper"> <h2 class="comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=13&amp;2=field_blog_comments&amp;3=comment" token="IKqqNGzna0isfyEknk_oRE2sfWThSeFDbglHdf4AmjA"></drupal-render-placeholder> </div> </section> Mon, 22 May 2017 23:03:29 +0000 dave 13 at http://tech.oeru.org Upgrading your Docker Apps: MongoDB, Wekan, and Rocket.Chat http://tech.oeru.org/node/6 <span class="field field--name-title field--type-string field--label-hidden">Upgrading your Docker Apps: MongoDB, Wekan, and Rocket.Chat</span> <div class="field field-node--field-blog-tags field-name-field-blog-tags field-type-entity-reference field-label-above"> <h3 class="field__label">Blog tags</h3> <div class="field__items"> <div class="field__item field__item--wekan"> <span class="field__item-wrapper"><a href="/taxonomy/term/15" hreflang="en">wekan</a></span> </div> <div class="field__item field__item--rocketchat"> <span class="field__item-wrapper"><a href="/taxonomy/term/18" hreflang="en">rocket.chat</a></span> </div> <div class="field__item field__item--mongodb"> <span class="field__item-wrapper"><a href="/taxonomy/term/14" hreflang="en">mongodb</a></span> </div> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/1" class="username">dave</a></span> <span class="field field--name-created field--type-created field--label-hidden">Thu 24/11/2016 - 10:56</span> <div class="clearfix text-formatted field field-node--body field-name-body field-type-text-with-summary field-label-hidden"> <div class="field__items"> <div class="field__item"><p>(Update 2017-05-24: see an <a href="/docker-compose-better-way-deploy-rocketchat-wekan-and-mongodb">easier way to run</a> Wekan, Rocketchat, and MongoDB) You may not have all of these installed, but if you're running <a href="/node/4">Wekan</a> or Rocket.Chat based on our instructions, you'll also have <a href="/node/3">MongoDB</a>, and the need to keep them all up-to-date to benefit from their rapid development processes (quick bug fixes and new and improved features every few days!).</p> <p>I'd recommend doing an upgrade monthly or more rapidly if you hear about security issues, or fixes to any bugs which might be affecting you.</p> <h2>Upgrading Step By Step</h2> <p>1. find the 3 IDs of the mquandalle/wekan, rocketchat/rocket.chat, and mongo containers you're running via</p> <p><code>docker ps</code></p> <p>The output might look something like this:</p> <p><code>5c35737f4de2      mongo                         "/entrypoint.sh mongo"   45 hours ago        Up 45 hours         27017/tcp                                        oeru-mongo<br /> 7e8ef524ba0a        mquandalle/wekan              "/bin/sh -c 'bash $ME"   45 hours ago        Up 45 hours         127.0.0.1:5555-&gt;80/tcp                           plan<br /> b370ad72f358        rocketchat/rocket.chat        "node main.js"           45 hours ago        Up 45 hours         127.0.0.1:7996-&gt;3000/tcp                         chat</code></p> <p>in this case, the relevant IDs are 5c35737f4de2, 7e8ef524ba0a, and b370ad72f358</p> <p>2. Stop the containers:</p> <p>docker stop 5c35737f4de2 7e8ef524ba0a b370ad72f358</p> <p>3. Remove the old containers (not the images):</p> <p><code>docker rm 5c35737f4de2 7e8ef524ba0a b370ad72f358</code></p> <p>4. Update the images to the latest versions for each.</p> <p><code>docker pull mongo<br /> docker pull mquandalle/wekan<br /> docker pull rocketchat/rocket.chat</code></p> <p>5. restart updated MongoDB (create new container) using the same "docker run" command you used initially.</p> <p>6. similarly restart your updated Rocket.Chat and Wekan containers, using exactly the same "docker run" command you used initially.</p> <p> </p> </div> </div> </div> <section class="field field-node--field-blog-comments field-name-field-blog-comments field-type-comment field-label-above comment-wrapper"> <a name="comments"></a> <div class="comment-form-wrapper"> <h2 class="comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=6&amp;2=field_blog_comments&amp;3=comment" token="dpYbd2vVnCJCXcQ8O44h111--q6kOHp4vaZqvGM8kLU"></drupal-render-placeholder> </div> </section> Wed, 23 Nov 2016 21:56:41 +0000 dave 6 at http://tech.oeru.org http://tech.oeru.org/node/6#comments Installing Wekan with Docker on Ubuntu Linux 14.04 http://tech.oeru.org/installing-wekan-docker-ubuntu-linux-1404 <span class="field field--name-title field--type-string field--label-hidden">Installing Wekan with Docker on Ubuntu Linux 14.04</span> <div class="field field-node--field-blog-tags field-name-field-blog-tags field-type-entity-reference field-label-above"> <h3 class="field__label">Blog tags</h3> <div class="field__items"> <div class="field__item field__item--install"> <span class="field__item-wrapper"><a href="/taxonomy/term/11" hreflang="en">install</a></span> </div> <div class="field__item field__item--ubuntu-linux"> <span class="field__item-wrapper"><a href="/taxonomy/term/12" hreflang="en">ubuntu linux</a></span> </div> <div class="field__item field__item--_404"> <span class="field__item-wrapper"><a href="/taxonomy/term/13" hreflang="en">14.04</a></span> </div> <div class="field__item field__item--mongodb"> <span class="field__item-wrapper"><a href="/taxonomy/term/14" hreflang="en">mongodb</a></span> </div> <div class="field__item field__item--wekan"> <span class="field__item-wrapper"><a href="/taxonomy/term/15" hreflang="en">wekan</a></span> </div> <div class="field__item field__item--docker"> <span class="field__item-wrapper"><a href="/taxonomy/term/16" hreflang="en">docker</a></span> </div> <div class="field__item field__item--lets-encrypt"> <span class="field__item-wrapper"><a href="/taxonomy/term/17" hreflang="en">let&#039;s encrypt</a></span> </div> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/1" class="username">dave</a></span> <span class="field field--name-created field--type-created field--label-hidden">Thu 27/10/2016 - 14:12</span> <div class="field field-node--field-image field-name-field-image field-type-image field-label-hidden has-multiple"> <figure class="field-type-image__figure image-count-1"> <div class="field-type-image__item"> <a href="http://tech.oeru.org/sites/default/files/styles/max_1300x1300/public/2016-11/Wekan.png?itok=DTYp9TJz" aria-controls="colorbox" aria-label="{&quot;alt&quot;:&quot;OERu&#039;s Wekan instance&quot;}" role="button" title="OERu&#039;s Wekan instance" data-colorbox-gallery="gallery-field_image-QgyA2tUfJw0" class="colorbox" data-cbox-img-attrs="{&quot;alt&quot;:&quot;OERu&#039;s Wekan instance&quot;}"><img src="/sites/default/files/styles/medium/public/2016-11/Wekan.png?itok=a6RIb_sO" width="220" height="112" alt="OERu&#039;s Wekan instance" loading="lazy" class="image-style-medium" /> </a> </div> </figure> <figure class="field-type-image__figure image-count-2"> <div class="field-type-image__item"> <a href="http://tech.oeru.org/sites/default/files/styles/max_1300x1300/public/2016-11/Wekan2.png?itok=CFI0It_1" aria-controls="colorbox" aria-label="{&quot;alt&quot;:&quot;Editing a task, setting participants and priorites&quot;}" role="button" title="Editing a task, setting participants and priorites" data-colorbox-gallery="gallery-field_image-QgyA2tUfJw0" class="colorbox" data-cbox-img-attrs="{&quot;alt&quot;:&quot;Editing a task, setting participants and priorites&quot;}"><img src="/sites/default/files/styles/medium/public/2016-11/Wekan2.png?itok=IfrWQAmQ" width="220" height="113" alt="Editing a task, setting participants and priorites" loading="lazy" class="image-style-medium" /> </a> </div> </figure> </div> <div class="clearfix text-formatted field field-node--body field-name-body field-type-text-with-summary field-label-hidden"> <div class="field__items"> <div class="field__item"><p><a href="https://wekan.org">Wekan</a> is an excellent, easy-to-use "kanban board" project management support tool, suitable for all manner of projects. For those who have used the highly marketed Trello kanban service, Wekan is functionally similar open source alternative that organisations can host and control for themselves. They can also enhance it in whatever ways they are moved to do so. We encourage our partner institutions to consider this path as a way of reducing costs as well as increasing freedom and privacy. To make migrating a win-win, we have also found that Wekan is able to import entire Trello boards, preserving your data. (Update: 2017-05-24 we've just published an <a href="/docker-compose-better-way-deploy-rocketchat-wekan-and-mongodb">easier way to run</a> Wekan and MongoDB)</p> <p>The OERu <a href="https://plan.oeru.org">provides a Wekan instance</a> that has proven very popular with our Open Education Resource designers and collaborators.</p> <p>Wekan instances store their data in another open source tool, a key-value storage engine called <a href="https://www.mongodb.com/">MongoDB</a> - these instructions assume that you have already got a running MongoDB installed, and to facilitate that, we've provided this <a href="/node/3">handy MongoDB install guide</a> as a companion.</p> <p>This guide will cover both configuring and launching a Docker container with a working instance of Wekan. It will, in turn, be linked to another Docker container running MongoDB, and both will be capable of sending email via external authenticating email server. External user access to Wekan is provided by the Nginx web server (as a forward proxy). User interaction with Wekan is (and should always be) encrypted via recognised SSL certificates using the brilliant (and gratis) <a href="http://letsencrypt.org">Let's Encrypt</a> service.</p> <p>This instruction set assumes that you have command-line access (via SSH, in most cases) to your server, running Ubuntu Linux 14.04, probably a Virtual Machine hosted in a data centre somewhere - a very inexpensive way to do this is, for example, via <a href="https://digitalocean.com">DigitalOcean</a> (for the record, we have no relationship with DigitalOcean, I simply have substantial experience with their services), but there are many many options worldwide. These instructions will need to be modified slightly for other versions of Linux (e.g. Debian 8 or Ubuntu 16.04 or CentOS or others), but should be mostly valid. We'd be grateful to hear about anyone else's experiences in the comments below!</p> <h2>Installing Docker</h2> <p>See our instructions in the <a href="/node/3">MongoDB blog post</a>.</p> <h2>Installing Wekan</h2> <p>First, we would normally create a wekan user:</p> <p><code>sudo adduser wekan</code></p> <p>and then create a directory in that user's space to store Wekan-related data (so it survives updates to the Docker image):</p> <p>sudo -u wekan mkdir /home/wekan/public</p> <p>Assuming you've got Docker installed properly, to install the official Wekan Docker image, you can just run:</p> <p><code>docker pull mquandalle/wekan</code></p> <p>Then you can launch it by running this by first launching your MongoDB container, and then running this (assumes you've named your MongoDB instance "mongodb" as per our <a href="/node/3">instructions</a>):</p> <p><code>docker run -d --name wekan -p 127.0.0.1:5555:80 \<br />          -h [your_Wekan_domain] -e "VIRTUAL_HOST=[your_Wekan_domain]" \<br />          -v /home/wekan/public:/built_app/programs/web.browser/app \<br />          -e "MAIL_URL=[outgoing_mail_server]" \<br />          --link mongodb:mongo -e "MONGO_URL=mongodb://mongo/plan" \<br />          -e "ROOT_URL=http://[your_Wekan_domain]" \<br />          --restart unless-stopped mquandalle/wekan</code></p> <p><strong>Note: Please copy and paste the exact text of your "docker run" command into a reference file (I usually have a "README.oeru" reference file in the home directory of each Docker-based app I run)  as you will want to refer to it when doing upgrades!</strong></p> <p>You'll need to make sure you set appropriate values for [your_Wekan_domain] and details for an SMTP (outgoing mail) server, because Wekan needs to send emails. You can use either a local mail server on the Docker host, in which case you'd put the local IP address of your server, as it would be seen by the Docker container, so 172.17.42.1 is the default IP of a Docker host. You could also use an authenticating SMTP server, and specify the details like this: <code>smtp://[username]:[password]@[IP-or-domainname]:[port, usually 25, 465, or 587].</code> Here's a what a made-up example might look like:</p> <p><code>-e "MAIL_URL=smtp://smtpmail:blahdiblah88@mail.oeru.org:25"</code></p> <p>Note, the <code>--restart unless-stopped</code> will ensure that this container is restarted on a reboot unless it's explicitly stopped, like via a <code>docker stop wekan</code>, like you might to update the Docker container.</p> <h2>Setting up Nginx as a proxy server</h2> <p>Having set up the Docker container, which is listening on port 5555 on the Docker container's <em>host</em>, you'll need to set up a reverse proxy on that host to make the site visible to the broader internet on your public IP address (you'll want to make sure the domain you specified above points to that IP address or is a CNAME to a domain that does).</p> <p>Once you've got that, you can proceed. In /etc/nginx/sites-available, I create a file called plan (as we use plan.oeru.org as our domain). Note, I use "vim" as my text editor. If you don't know it, perhaps use "nano" instead. It's much less powerful, but easier to use...</p> <p><code>sudo vim /etc/nginx/sites-available/plan</code></p> <p>Here're the contents - you'll want to change the domain name to suit your own choices. Similarly the names of SSL files and logs. The following file has a chunk in the middle commented out with "#s". More on that below:</p> <p><blockcode><code># from https://github.com/wekan/wekan/wiki/Install-Wekan-Docker-in-production<br /> upstream websocket {<br />         server 127.0.0.1:5555;<br /> }</code></blockcode></p> <p><blockcode><code>map $http_upgrade $connection_upgrade {<br />         default upgrade;<br />         '' close;<br /> }</code></blockcode></p> <p><blockcode><code>server {<br />         listen  80; # this is one of our external IPs on the server.<br />         #listen   [::]:80 default ipv6only=on; ## listen for ipv6<br /><br />         root /usr/share/nginx/www;<br />         index index.html index.htm;<br /><br />         server_name plan.oeru.org;<br /><br />         access_log /var/log/nginx/plan.oeru.org_access.log;<br />         error_log /var/log/nginx/plan.oeru.org_error.log;<br /><br />         location /.well-known {<br />                 root /var/www/html;<br />                 default_type text/plain;<br />         }<br /><br /> #        location / {<br /> #                return 301 https://plan.oeru.org$request_uri;<br /> #        }       <br /> #}<br /> #<br /> #server {<br /> #        listen 443 ssl;<br /> #        ssl on;<br /> #        ssl_certificate /etc/letsencrypt/live/plan.oeru.org/fullchain.pem;<br /> #        ssl_certificate_key /etc/letsencrypt/live/plan.oeru.org/privkey.pem;</code><br /><code># </code><code>       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br /> #        ssl_dhparam /etc/ssl/certs/dhparam.pem;<br /> #        keepalive_timeout 20s;<br /> #<br /> #        access_log /var/log/nginx/plan.oeru.org_access.log;<br /> #        error_log /var/log/nginx/plan.oeru.org_error.log;</code></blockcode><blockcode><br /><code>#        root /var/www/html;<br /> #        index index.html index.htm;</code></blockcode><blockcode><br /><code>#        server_name plan.oeru.org;<br /> #<br /> #        location /.well-known {<br /> #                root /var/www/html;<br /> #                default_type text/plain;<br /> #        }</code></blockcode></p> <p><blockcode><code>        location / {<br />                 proxy_read_timeout      300;<br />                 proxy_connect_timeout   300;<br />                 proxy_redirect          off;<br />                 proxy_set_header    X-Real-IP           $remote_addr;<br />                 proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;<br />                 proxy_set_header    X-Forwarded-Proto   $scheme;<br />                 proxy_pass      http://127.0.0.1:5555;<br />                 proxy_set_header Host           $host;<br />         }</code></blockcode></p> <p><blockcode><code>        location ~ websocket$ {<br />                 proxy_pass http://websocket;<br />                 proxy_http_version 1.1;<br />                 proxy_set_header Upgrade $http_upgrade;<br />                 proxy_set_header Connection $connection_upgrade;<br />         }<br /> }</code></blockcode></p> <p>When you've set up the file, you can enable it:</p> <p><code>sudo ln -sf /etc/nginx/sites-available/plan /etc/nginx/sites-enabled</code></p> <p>Test the file to ensure there aren't any syntax errors before reloading nginx:</p> <p><code>sudo nginx -t</code></p> <p>If this shows an error, you'll need to fix the file. If all's well, reload nginx to include the new configuration:</p> <p><code>sudo service nginx reload</code></p> <p>You should now be able to point your browser at your domain name, and you should get your Wekan site via the HTTP (not encrypted) protocol.</p> <p>A word to the wise - if it doesn't work, check your firewall settings!</p> <p>In the next step, we'll sort out your SSL certificate from <a href="https://letsencrypt.org/" title="Let's Encrypt - libre and gratis SSL certificates">Let's Encrypt</a>.</p> <h2>Protecting your users</h2> <p>Have a look at our <a href="/protecting-your-users-lets-encrypt-ssl-certs">Let's Encrypt howto</a>.</p> <h2>Upgrading Wekan</h2> <p>You should periodically upgrade Wekan, say every couple months, to benefit from improved features... The upgrade process usually means a few minutes of down time for the site, so pick a time when it isn't likely to be heavily used... You'll normally want to upgrade any dependent Docker containers at the same time (like <a href="/node/3">your MongoDB</a> and <a href="/node/5">Rocket.Chat</a>) so we have a <a href="/node/6">dedicated Upgrade article</a> for that.</p> <p> </p> </div> </div> </div> <section class="field field-node--field-blog-comments field-name-field-blog-comments field-type-comment field-label-above comment-wrapper"> <a name="comments"></a> <div class="comment-form-wrapper"> <h2 class="comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=4&amp;2=field_blog_comments&amp;3=comment" token="uc1Lb6EN7BABm6o1LG_bvkNtKR1zMSzFvkh2eSYvs90"></drupal-render-placeholder> </div> </section> Thu, 27 Oct 2016 01:12:48 +0000 dave 4 at http://tech.oeru.org