chenqinghe 4 лет назад
Родитель
Сommit
514d283dfd
3 измененных файлов: 8 добавлений и 4 удалений
  1. 3
    1
      Dockerfile
  2. 2
    1
      cmd/webpprof/main.go
  3. 3
    2
      web/vue.config.js

+ 3
- 1
Dockerfile Просмотреть файл

@@ -35,4 +35,6 @@ COPY --from=frontend /web/dist/   /app/html/
35 35
 
36 36
 EXPOSE 8090
37 37
 
38
-ENTRYPOINT ["/app/webpprof"]
38
+WORKDIR /app
39
+
40
+ENTRYPOINT ["./webpprof"]

+ 2
- 1
cmd/webpprof/main.go Просмотреть файл

@@ -18,8 +18,9 @@ import (
18 18
 func main() {
19 19
 	r := gin.Default()
20 20
 
21
-	r.Static("/", "html")
21
+	r.Static("/html", "html")
22 22
 
23
+	r.GET("/", func(c *gin.Context) { c.Redirect(http.StatusFound, "/html/") })
23 24
 	r.POST("/upload", upload)
24 25
 	r.GET("/pprof/:hash/:method", mapping)
25 26
 

+ 3
- 2
web/vue.config.js Просмотреть файл

@@ -3,5 +3,6 @@ module.exports = {
3 3
     // 选项...
4 4
     devServer: {
5 5
         proxy: 'http://localhost:8090'
6
-    }
7
-}
6
+    },
7
+    publicPath: '/html'
8
+}