Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-coldbrew/cookiecutter-coldbrew
A cookiecutter template to build golang services powered by ColdBrew
https://github.com/go-coldbrew/cookiecutter-coldbrew
coldbrew cookiecutter docker framework golang lightweight microservice
Last synced: 2 months ago
JSON representation
A cookiecutter template to build golang services powered by ColdBrew
- Host: GitHub
- URL: https://github.com/go-coldbrew/cookiecutter-coldbrew
- Owner: go-coldbrew
- License: mit
- Created: 2021-01-08T14:57:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T02:46:25.000Z (5 months ago)
- Last Synced: 2024-09-13T15:17:15.688Z (5 months ago)
- Topics: coldbrew, cookiecutter, docker, framework, golang, lightweight, microservice
- Language: Go
- Homepage:
- Size: 5.72 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS.md
Awesome Lists containing this project
README
# cookiecutter-coldbrew
Powered by [Cookiecutter](https://github.com/audreyr/cookiecutter), Cookiecutter Coldbrew is a framework for jumpstarting production-ready go projects quickly.
## Features
- Generous `Makefile` with management commands
- injects build time and git hash at build time.
- Powered by [ColdBrew](https://docs.coldbrew.cloud)## Constraints
- Uses `mod` for dependency management
- Only maintained 3rd party libraries are used.
- Use multistage docker builds for super small docker images
- Make sure '$GOBIN' is set in PATH## Docker
This template uses docker multistage builds to make images slimmer and containers only the final project binary and assets with no source code whatsoever.
## Usage
Let's pretend you want to create a project called "echoserver".
Rather than starting from scratch maybe copying some files and then editing the results to include your name, email, and various configuration issues that always get forgotten until the worst possible moment, get cookiecutter to do all the work.
### Prerequisites
First, get Cookiecutter. Trust me, it's awesome:```shell
$ pip install cookiecutter
```Alternatively, you can install `cookiecutter` with homebrew:
```shell
$ brew install cookiecutter
```
### Using the ColdBrew Cookiecutter TemplateTo run it based on this template, type:
```shell
$ cookiecutter gh:go-coldbrew/cookiecutter-coldbrew
```You will be asked about your basic info \(name, project name, app name, etc.\). This info will be used to customise your new project.
### Providing your app information to the cookiecutter
Warning: After this point, change 'github.com/ankurs', 'MyApp', etc to your own information.
Answer the prompts with your own desired options. For example:
```shell
source_path [github.com/ankurs]: github.com/ankurs
app_name [MyApp]: MyApp
grpc_package [github.com.ankurs]: github.com.ankurs
service_name [MySvc]: MySvc
project_short_description [A Golang project.]: A Golang project
docker_image [alpine:latest]:
docker_build_image [golang]:
Select docker_build_image_version:
1 - 1.19
2 - 1.20
Choose from 1, 2 [1]: 2
```### Checkout your new project
Enter the project and take a look around:
```shell
$ cd MyApp/
$ ls
```Run `make help` to see the available management commands, or just run `make build` to build your project.
```shell
$ make run
```
### Working with your new projectYour project is now ready to be worked on. You can find the generated `README.md` file in the project root directory. It contains a lot of useful information about the project. You can also find the generated `Dockerfile` in the project root directory. It contains a lot of useful commands to build, test, and run your project. You can also find the generated `Makefile` in the project root directory. It contains a lot of useful commands to build, test, and run your project. You can run `make help` to see the available management commands.