Skip to content

celliott/starter-bundle

Repository files navigation

Starter Bundle

TODO Add github action to build and store in github archives

Base docker apline images

Setup A New Example Project Repo

Applications

Add App(s) dir to ./apps dir. All apps must include Dockerfile.
docker \
  api
    src
    Dockerfile
  frontend
    src
    Dockerfile

Docker Compose

Create docker-compose.yml v2 that specifies build location for each app.

NOTE ENVs are seeded from docker.mk

version: '2'
services:
  api:
    build: docker/api
    image: ${ORGANIZATION}/${API_NAME}:${BUILD_TAG}
  frontend:
    build: docker/frontend
    image: ${ORGANIZATION}/${APP_NAME}:${BUILD_TAG}

Make and default.mk

Add application ENVs to default.mk
...
# Service Vars
NAME=starter-bundle

# API Vars
API_NAME=starter-bundle-api
API_PORT=3000
API_USER=admin
API_PASS=mypassword

# APP Vars
APP_NAME=starter-bundle-frontend
APP_PORT=5000
Add docker commands to Makefile
init :
	-helm init --upgrade

config : init
	docker-compose config --quiet

build : config
	docker-compose build

up : init
	docker-compose up -d

down :
	docker-compose down

push : build
	docker-compose push

Helm Chart

Add helm chart to repo helm/<service_name>

NOTE this step is not documented b/c charts will be different depending on the application requirements. A good starting point: How To Create Your First Helm Chart

Add helm upgrade command in Makefile with ENV overrides
deploy : init
  -kubectl create namespace $(NAMESPACE)
  -helm init
	-kubectl create namespace $(NAMESPACE)
	helm upgrade -i $(SERVICE) helm/$(SERVICE) \
		--namespace $(NAMESPACE) \
		--set build.tag=$(BUILD_TAG) \
		-f values.yaml \
		--timeout 120 \
		--wait

delete :
	helm del --purge $(SERVICE)

About

Example starter application for deploying to k8s using helm

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors