https://github.com/otoshimtoshi/go-docker-template
https://github.com/otoshimtoshi/go-docker-template
air-verse docker docker-compose gin-gonic go go-delve godotenv golang gorm live-reload
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/otoshimtoshi/go-docker-template
- Owner: otoshimtoshi
- License: mit
- Created: 2025-01-26T14:02:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-09T15:36:30.000Z (over 1 year ago)
- Last Synced: 2025-08-03T06:25:46.424Z (11 months ago)
- Topics: air-verse, docker, docker-compose, gin-gonic, go, go-delve, godotenv, golang, gorm, live-reload
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-docker-template
## Library
- Web フレームワーク:[gin-gonic](https://github.com/gin-gonic/gin)
- ORM:[go-gorm](https://github.com/go-gorm/gorm)
- ホットリロード:[air-verse/air](https://github.com/air-verse/air)
- デバッグ:[go-delve/delve](https://github.com/go-delve/delve)
## Docker
```sh
# バックグラウンド実行の場合
% docker compose up -d
# ログ出力あり実行の場合
% docker compose up
```
## Go Modules
```sh
% go mod tidy
```
## Database Migration
```sh
% docker exec -it go-api sh
% migrate -database 'mysql://root:password@tcp(go-db:3306)/sample' -path migrations up
% migrate -database 'mysql://root:password@tcp(go-db:3306)/sample' -path migrations down
% go run seeds/seeder.go
```
## Linting
```sh
% golangci-lint run
% golangci-lint run --fix
```