Govinor is a platform to deploy and preview docker containers.

Overview

Govinor

A platform for creating and managing Docker containers that integrates with Github to offer branch preview links.

Note: This is a work in progress. The current focus is to deploy Strapi containers.

How does it work?

Govinor listens to Github webhooks of a repo of your choice and creates and manages Docker containers with preview links.

Development

From your terminal:

npm run dev

This starts your app in development mode, rebuilding assets on file changes.

⚠️ Note: Govinor carries out a lot of work using shell commands that won't probably work on your local machine. The target OS is Ubuntu 20.04. These functionalities needs to be mocked in order to be tested locally, so for now dev mode is only meant for testing UI changes to the Govinor dashboard.

Deployment

If you need to setup a new server read the instructions below on "Setup AWS resources" and "Install Govinor on the server".

When you need to deploy a new version of govinor, run the following commands:

cd ~/govinor;
git pull;
npm install;
npm run build;
npm run deploy;

Setup AWS resources

First, create an AWS account and create an IAM user with these permissions:

  • AmazonEC2FullAccess
  • AmazonRDSFullAccess
  • AmazonS3FullAccess

Launch an EC2 instance

  1. Choose AMI: Ubuntu Server 20.04 LTS (x86)
  2. Choose instance type: t3.medium
  3. Configure instance: -
  4. Add Storage: Select 50GB
  5. Add tags: -
  6. Configure security groups: Create a new group named govinor with description govinor instance security settings and add the following rules:
  • Type: SSH, Protocol: TCP, Port: 22, Source: 0.0.0.0/0
  • Type: SSH, Protocol: TCP, Port: 22, Source: ::/0
  • Type: HTTP, Protocol: TCP, Port: 80, Source: 0.0.0.0/0, ::/0
  • Type: HTTPS, Protocol: TCP, Port: 443, Source: 0.0.0.0/0, ::/0

Finally hit "Launch" and create a new key pair (e.g. govinor-key-pair) and save it to your computer.

Install Docker

Follow the instructions on How To Install and Use Docker on Ubuntu 20.04 to install Docker for Ubuntu 20.04.

⚠️ Important: Make sure to follow Step 2 to enable docker execution without the sudo command

Install Docker Compose

Follow the instructions "Install on Linux" to install Docker Compose.

Install Caddy Server

Follow the instructions for "Ubuntu" to install Caddy.

Install Node.js

To make it easier to manage and upgrade Node versions, we recommend using Node Version Manager.

To install Node.js, run the following command:

nvm install 14

Install govinor on the server

Prerequisites

You need to have a Github webhook configured for the repo you want to deploy. Head to your repo settings and add a webhook that points to the following settings:

Select also "Send me everything".

Install

To install govinor, you need to SSH into your EC2 instance and run the following commands:

  1. Create deployment folder: mkdir -p ~/deployments
  2. Clone this repo
  3. cd into the repo: cd govinor
  4. Add .env file cp .env.example .env and
  5. Edit .env: change ADMIN_USERNAME, ADMIN_PASSWORD and set GITHUB_WEBHOOK_SECRET
  6. Install dependencies: npm install
  7. Build app: npm run build
  8. Create systemd service: sudo cp -i ~/govinor/service/govinor.service /etc/systemd/system
  9. Enable govinor systemd service: sudo systemctl enable govinor.service
  10. Start govinor systemd service: sudo systemctl start govinor

Check that govinor service is running by running the following command:

sudo systemctl status govinor

Finally as the last step initialize the Caddy config:

./scripts/init-caddy.sh

Debug

For convenience here a few useful commands for diagnosing problems:

# Check govinor service status
systemctl status govinor

# Look up service logs
journalctl -u govinor -b -r

# Restart govinor service (you may need to run this with sudo)
systemctl restart govinor

# Reload Systemd when you change service configuration
sudo systemctl daemon-reload

# View the process running govinor
lsof -i tcp:3000
You might also like...

local docker-compose environment to deploy and configure backoffice

backoffice-local local docker-compose environment to deploy and configure backoffice How to install To install the repo dependencies yarn install be s

Dec 15, 2022

Remix TypeScript monorepo with Turborepo pipelines, Prisma, PostgreSQL, Docker deploy to Fly.io, pnpm, TailwindCSS and Tsyringe for DI.

Remix TypeScript monorepo with Turborepo pipelines, Prisma, PostgreSQL, Docker deploy to Fly.io, pnpm, TailwindCSS and Tsyringe for DI.

Remix template with Turborepo, TypeScript and pnpm. The remix app deploys to fly.io or build to Docker image. Example packages for Database with prisma, Tsyringe dependency injection, UI, and internal TypeScript packages.

Dec 29, 2022

A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose

A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose

Turborepo + Strapi + Next.js + Docker A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose. ⚠️ Prerequisit

Dec 29, 2022

Docker Extension to backup and restore docker volumes.

Docker Extension to backup and restore docker volumes.

vackup-docker-extension This repository contains a Docker Extension that backups Docker volumes. This extension is purely a demonstration of how it'd

Dec 28, 2022

This provides an extension integration with Docker Desktop to run k9s quickly and easily through the Docker Desktop interface.

This provides an extension integration with Docker Desktop to run k9s quickly and easily through the Docker Desktop interface.

k9s extension for Docker Desktop This provides an extension integration with Docker Desktop to allow k9s quickly and easily through the Docker Desktop

Dec 16, 2022

Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan CLI Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose. What is A

Aug 17, 2022

An example T3 app containerized with Docker, Docker Compose, and deployed on Railway

Create T3 App This is an app bootstrapped according to the init.tips stack, also known as the T3-Stack. What's next? How do I make an app with this? W

Dec 19, 2022

🧰 Javascript array-like containers for multithreading

بسم الله الرحمن الرحيم Struct Vec 🧰 Javascript array-like containers for multithreading Efficiently communicating between js workers is a pain becaus

Jun 23, 2022

Simple auto-scaling for Amazon Lightsail Containers written in Javascript

About Amazon Lightsail Containers is one of the easiest way to run container based app on AWS. It automatically sets up a load balanced TLS endpoint,

Oct 22, 2022
Owner
iFixit
iFixit
A Restaurant (Table) Reservation API built with Node, TypeScript, Express, TypeORM, a MySQL DB, all running on Docker containers

Restaurant (Table) Reservation API A simple API for reserving tables at a restaurant. The API is based on the REST architectural style and uses Node.j

null 14 Oct 5, 2022
Docker: Criando containers sem dor de cabeça.

Docker: Criando containers sem dor de cabeça. A evolução do host de aplicações Antigamente... Várias aplicações, vários servidores. Capacidade pouco a

Lucas Magalhães 3 Jun 23, 2022
A Restaurant (Table) Reservation API built with Node, TypeScript, Express, TypeORM, a MySQL DB, all running on Docker containers

Restaurant (Table) Reservation API A simple API for reserving tables at a restaurant. The API is based on the REST architectural style and uses Node.j

null 14 Oct 5, 2022
Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)

Homarr A homepage for your server. Demo ↗️ • Install ➡️ Join the discord! ?? Table of Contents ?? Table of Contents ?? Getting Started ℹ️ About ?? Kno

Thomas Camlong 1.6k Jan 7, 2023
Running webdriverio in docker containers so you can easily add tests to your CI.

WebDriverIO tests in Docker Running WebdriverIO tests in a docker container allows you to easily add tests to your CI. About This project uses the aut

Promenade 6 Dec 3, 2022
⛴ Manage Docker containers from the menu bar.

Captain INTRODUCTION Manage Docker containers. Instantly from the menu bar. See which containers are running and which have stopped. Conveniently star

Rick Wong 19 Dec 8, 2022
Codebraid Preview provides a Markdown preview for Pandoc documents within VS Code.

Codebraid Preview provides a Markdown preview for Pandoc documents within VS Code. Most Markdown previews don't support all of Pandoc's extensions to Markdown syntax. Codebraid Preview supports 100% of Pandoc features—because the preview is generated by Pandoc itself! There is also full bidirectional scroll sync and document export.

Geoffrey Poore 12 Dec 28, 2022
Get an isolated preview database for every Netlify Preview Deployment

Netlify Preview Database Plugin Create an isolated preview database for each preview deployment in Netlify Quickstart • Website • Docs • Discord • Twi

Snaplet 10 Nov 16, 2022
The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate application for learning out how to build, run and deploy a multi-container environment (docker-compose).

foodtrucks-app-docker-compose The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate applic

Selçuk Şan 3 Oct 24, 2022
For this workshop, we're going to learn more about cloud computing by exploring how to use Pulumi to build, configure, and deploy a real-life, modern application using Docker

For this workshop, we're going to learn more about cloud computing by exploring how to use Pulumi to build, configure, and deploy a real-life, modern application using Docker. We will create a frontend, a backend, and a database to deploy the Pulumipus Boba Tea Shop. Along the way, we'll learn more about how Pulumi works.

Kat Cosgrove 9 Dec 29, 2022