Skip to content

Commit

Permalink
添加dockerfile README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
carrot-hu23 committed Jun 17, 2023
1 parent 8738ad1 commit 64b0bdc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/dcokerfile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# docker 打包

打包需要的文件如下
```
├── Dockerfile
├── dst-admin-go
├── run.sh
```

**打包**
```
docker build -t dst-admin-go .
```

**运行**
```
dcoker run -d -p8082:8082 dst-admin-go
```
等看到 docker logs 说明启动成功了

```text
[GIN-debug] GET /favicon.ico --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] HEAD /favicon.ico --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] GET /asset-manifest.json --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] HEAD /asset-manifest.json --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] GET / --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] HEAD / --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (6 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on :8082
```
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ import (
"dst-admin-go/config/global"
"dst-admin-go/initConfig"
"dst-admin-go/router"
"embed"
"fmt"
)

func init() {
initConfig.Init()
}

// 嵌入为一个文件系统 新的文件系统FS
//
//go:embed dist
//go:embed static
var f embed.FS

func main() {

app := router.NewRoute()
Expand Down

0 comments on commit 64b0bdc

Please sign in to comment.