Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modern Pet Project Hosting

Modern Pet Project Hosting

Slides of my presenation at the Eindhoven Developers Meetup. (https://www.meetup.com/Eindhoven-Developers-Meetup/events/237518045/)

This presentation is about "Modern Pet Project Hosting".

It covers an example of a pet project. The complexity that you will face to get it on-line "the classical way" and it introduces a solution by using modern technologies like Docker-machine and Caddy web server.

The demonstration is about how to create a docker-machine and how to run a docker-compose file which includes a Caddy based project.

The summary gives an overview of what we have seen and what it can provide to you as a developer.

The example project can be found on GitHub:
https://github.com/Ecno92/modern-pet-project-hosting

Therry van Neerven

March 29, 2017
Tweet

More Decks by Therry van Neerven

Other Decks in Programming

Transcript

  1. • Software development is craftsmanship • Make the world a

    better place ◦ Automate repetitive tasks ◦ Patch up bad designs ◦ Implement new (crazy) ideas • Build solutions for users
  2. • SendCloud developers have to: ◦ Remember to label issues

    with internal or external. ◦ Remember to log hours when moving to the next issue. ◦ Remember to inform 40 colleagues about changes in the platform. ◦ Remember to create a release in Sentry after every deployment. Who can save us?
  3. Is it an advanced life form resulting from years of

    machine learning? No, it is a basic Flask based application which waits for webhook events and calls some APIs to get things done.
  4. Requirements • Easy to deploy • No vendor lock-in •

    No restrictions: ◦ Any language ◦ Any library ◦ Any extra binary or server • Secure: ◦ Isolated applications ◦ HTTPS
  5. What it takes to get Gerrit online • Server: DigitalOcean,

    AWS, Linode, VULTR, TransIP, MS Azure, Google Cloud. • OS: CentOS, Ubuntu, Debian, Gentoo, Arch Linux, Fedora. • Base apps/config: UFW, Fail2Ban, Disable SSH password authentication. • App dependencies: Python, Python-dev, libxml2-dev, libxslt-dev. • App package: git pull, .deb/.rpm, .tar.gz. • App additions: SSL certificate, Reverse proxy/load balancer, supervisor.
  6. Docker(-compose) Allowed me: • To develop my application locally •

    To share it to other users (Docker Hub) But: • I did not know how to deploy my project. • Security and web server configuration was still a hassle.
  7. Docker-machine • Create and manage machines: ◦ Locally (Virtualbox, Hyper-V)

    ◦ Remote (Generic, AWS, Digital Ocean) ◦ Create, Start, Stop, Remove, SSH • Installs Docker engine during machine creation ◦ And it allows you to connect to it. ◦ docker, docker-compose commands talk to the "remote machine" • (Provision Swarm clusters)
  8. Caddy web server • Easy configuration: ◦ Modern feature set

    ◦ Easy to use directives ◦ Good defaults • Live sites are served over HTTPS automatically: ◦ Let's Encrypt is utilized to secure HTTP traffic. ◦ Automatic certificate renewal • Low entry level: ◦ Modern documentation ◦ Written in Go, available at Github
  9. Demonstration: Deploy a pet • We are going to Deploy

    an Dockerized example app: ◦ Caddy server: ▪ Static ▪ Markdown ▪ PHP ◦ Python reverse proxied container ▪ httpbin • Use a VULTR machine: ◦ docker-machine-vultr Driver ◦ Reserved IP
  10. Summary • Caddy provides a modern interface to the outside

    world • Docker-machine allows you to easily manage your containers and machines. • After creating your own "deployment foundation". You should be able to deploy things without an hassle. • When you feel comfortable in deploying your projects. You are empowered to make the world a better place.