Skeleton for run go service in docker
- Go 1.21+
- Node.js 20+
- Vue3 + daisyUI
- copy all file to project directory
- replace all
github.com/bitxeno/go-docker-skeleton
string to your repo - update
AppName
andAppDesc
variables inmain.go
- execute shell:
# open shell #1:
# for frontend hot reload
cd web/static
npm install
npm run dev
# open shell #2:
go mod tidy
go run . server -vv
# or hot reload with go 1.22+
go install github.com/air-verse/air@latest
air -c .air.toml
rm -rf web/static
git clone --depth=1 https://github.com/PanJiaChen/vue-admin-template.git web/static
cd web/static
rm -rf ./.git
npm install
chnage package.json
dev script to:
"dev": "vue-cli-service build --watch --mode production",
- register dockerhub and create a repo
- on Dockerhub, goto
Account Settings -> Security
create aceess token - on Github, goto repo
Settings -> Secrets
and add three github action variables
DOCKER_USERNAME
DOCKER_TOKEN
DOCKER_REPOSITORY
docker run -d --name=app-name --restart=always -p 8080:80 -v /path/to/config/dir:/data xxxx/app-name
- goutil: Helper Utils(600+)
- lo: samber/lo is a Lodash-style Go library based on Go 1.18+ Generics.
- validator: Package validator implements value validations for structs and individual fields based on tags.
- gods: GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more
- orderedmap: An ordered map in Go with amortized O(1) for Set, Get, Delete and Len.
- cron: a cron library for go
- gocron: Easy and fluent Go cron scheduling.
- gjson: Get JSON values quickly - JSON parser for Go
- ristretto: A high performance memory-bound Go cache
- theine-go: High performance in-memory & hybrid cache with generics support
- emitter: Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins
- event: Lightweight event manager and dispatcher implements by Go
- asynq: Simple, reliable, and efficient distributed task queue in Go
- goja: ECMAScript/JavaScript engine in pure Go
- do: ⚙️ A dependency injection toolkit based on Go 1.18+ Generics.
- errors: errors with stacktraces for go
- purego: A library for calling C functions from Go without Cgo.
- go-i18n: Translate your Go program into multiple languages
- vue-sonner: 🔔 An opinionated toast component for Vue.
- auto-animate: A zero-config, drop-in animation utility that adds smooth transitions to your web app.