Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.35 KB

README.md

File metadata and controls

61 lines (46 loc) · 1.35 KB

kuba

Prerequisites

  1. Docker
  2. Air for live reload during development
  3. Migrate CLI to manage migrations
  4. Mockgen to generate mocks

Installation

# install dependencies
make dep

# docker compose up
make setup-local

# run db migrations
make migrate-up

Running locally

Run this command and every changes you make will be automatically rebuild, thanks to Air.

make run

Building image

make build-docker

Or if you prefer to run the image locally

docker build --tag simple-app .
docker run --name simple simple-app

# automatically delete existing
docker run --name simple --rm simple-app

# bind to port $docker_host_port:$container_port
docker run -p 0.0.0.0:4001:4001 --name simple --rm simple-app

Using kubernetes locally

minikube start

kubectl cluster-info

# to point your shell to minikube's docker-daemon, run:
eval $(minikube -p minikube docker-env)

kubectl create -f deployment.yaml
kubectl create -f service.yaml

kubectl port-forward svc/simple-service 4001:4001
curl localhost:4001

# alternative to get the local endpoint url
minikube service simple-app --url