This is a simple boilerplate for boostraping microservices in go lang following Domain driven design architecture.
This boilerplate is using the following techs:
- HTTP: Echo
- Database: Postgres (default driver)
- Dependency Injection: Wire
- Mocks generation: gomock
- Github Deployment Workflow to heroku.
- download and build dependencies
$ make build
-
Provide a .env file as .env.example or export this environment variables
-
Run generated bin
$ export APP_ENV=development && ./app
- Generate a docker image
$ make build-docker
- Run it
$ docker run --env-file .env --net=host golang-ddd-template
Auto-deployment has been set up using github workflow to push a container to heroku. If you decide to deploy via heroku cli, see the steps below.
- Login to heroku
$ heroku login
- Create an application (if none exists)
$ heroku apps:create your-app-name
- Dockerize and push container to heroku container registry
$ heroku container:push web --app your-app-name
- Release container to your newly created application
$ heroku container:release web --app your-app-name
https://devcenter.heroku.com/articles/build-docker-images-heroku-yml