Skip to content
Rafał Lorenz edited this page Sep 6, 2018 · 20 revisions

Prerequisites

In order to run this project you need to have Docker > 1.17.05 for building the production image and Kubernetes cluster > 1.11 for running pods installed.

Instalation

git clone [email protected]:vardius/go-api-boilerplate.git

Configuration

Kubernetes deployments are located in ./cmd/BINARY_NAME directory.

Remember to change all imports from github.com/vardius/go-api-boilerplate/* to your-repository/*

Makefile

➜  go-api-boilerplate git:(master) ✗ make help
version                        Show version
key                            [HTTP] Generate key
cert                           [HTTP] Generate self signed certificate
docker-build                   [DOCKER] Build given container. Example: `make docker-build BIN=user`
docker-run                     [DOCKER] Run container on given port. Example: `make docker-run BIN=user PORT=3000`
docker-stop                    [DOCKER] Stop docker container. Example: `make docker-stop BIN=user`
docker-rm                      [DOCKER] Stop and then remove docker container. Example: `make docker-rm BIN=user`
docker-publish                 [DOCKER] Docker publish. Example: `make docker-publish BIN=user REGISTRY=https://your-registry.com`
docker-tag                     [DOCKER] Tag current container. Example: `make docker-tag BIN=user REGISTRY=https://your-registry.com`
docker-release                 [DOCKER] Docker release - build, tag and push the container. Example: `make docker-release BIN=user REGISTRY=https://your-registry.com`
kubernetes-create              [KUBERNETES] Create kubernetes deployment. Example: `make kubernetes-create BIN=user`
aws-repo-login                 [HELPER] login to AWS-ECR

Repository structure

Repository holds two top-level directories, pkg and cmd.

pkg contains directories for each of bounded context.

cmd contains directories for each of binaries.

Clone this wiki locally