https://github.com/arham09/go-dockerize-boilerplate
https://github.com/arham09/go-dockerize-boilerplate
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arham09/go-dockerize-boilerplate
- Owner: arham09
- Created: 2019-10-22T05:51:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-09T20:37:23.000Z (over 3 years ago)
- Last Synced: 2025-12-19T22:55:57.509Z (7 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Live Reload
Production ready boilerplate with live-reloading development
Read [this article](https://medium.com/@kdarutkin/how-to-live-reload-code-for-golang-and-docker-without-third-parties-ee90721ef641) first
## Using with Docker
Start production enviroment
```console
$ docker-compose up -d production
// View logs
$ docker-compose logs --tail 100 -f production
```
Start development enviroment
```console
$ docker-compose up dev
```
Re-building docker
```console
$ docker-compose build --no-cache
```
Attach to bash
```console
$ docker-compose exec sh
```
## Example
After running docker-compose open:
development: http://localhost:8080/
production: http://localhost:8081/
## Without docker
```bash
$ make serve
```
You may need to execute `go mod download` in `src` folder first
## Configure scripts
#### ./scripts/production.sh
```bash
cd src
go mod download
go build -o /bin/app && /bin/app
```
#### ./scripts/development.sh`
```bash
cd src
go run main.go
```