go-docker-skeleton

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

go-docker-skeleton licenseversion

Skeleton for run go service in docker

Prerequisite

  • Go 1.8+
  • Node.js 14+
  • Vue3 + daisyUI

How To Start

  1. copy all file to project directory
  2. replace all github.com/cxfksword/go-docker-skeleton string to your repo
  3. update AppName and AppDesc variables in main.go
  4. execute shell:
cd view
npm install
cd ..
go mod vendor

# open shell #1:
# for frontend hot reload
cd view
npm run dev

# open shell #2:
# for golang hot reload
go get -u https://github.com/cosmtrek/air
air -c .air.toml

How to integrated with vue-admin-template

rm -rf view
git clone --depth=1 https://github.com/PanJiaChen/vue-admin-template.git view
cd view
rm -rf ./.git
npm install

chnage package.json dev script to:

"dev": "vue-cli-service build --watch --mode production",

How to push DockerHub

  1. register dockerhub and create a repo
  2. on Dockerhub, goto Account Settings -> Security create aceess token
  3. on Github, goto repo Settings -> Secrets and add three github action variables
DOCKER_USERNAME
DOCKER_TOKEN
DOCKER_REPOSITORY

Run on Docker

docker run -d --name=app-name --restart=always -p 8080:80  -v /path/to/config/dir:/data xxxx/app-name

Great library

  • validator: Package validator implements value validations for structs and individual fields based on tags.
  • lo: samber/lo is a Lodash-style Go library based on Go 1.18+ Generics.
  • 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
  • goutil: Helper Utils(600+)
  • 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
  • gods: GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
app
cmd
db
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL