gin. allow code reload in dev mode
This commit is contained in:
parent
6fdff2109e
commit
3471ce25e1
3 changed files with 15 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/vendor
|
/vendor
|
||||||
/panelcli
|
/panelcli
|
||||||
/userpanel
|
/userpanel
|
||||||
|
gin-bin
|
||||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -3,11 +3,13 @@ RUN apk --no-cache add git gcc musl-dev
|
||||||
WORKDIR /go/src/git.lattuga.net/boyska/feedpanel/
|
WORKDIR /go/src/git.lattuga.net/boyska/feedpanel/
|
||||||
COPY ./ /go/src/git.lattuga.net/boyska/feedpanel/
|
COPY ./ /go/src/git.lattuga.net/boyska/feedpanel/
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
RUN go get ./... && CGO_ENABLED=0 GOOS=linux go install ./...
|
RUN go get github.com/codegangsta/gin && go get ./... && CGO_ENABLED=0 GOOS=linux go install ./...
|
||||||
|
CMD /go/bin/gin --all -p 8000 -d ./cmd/userpanel run
|
||||||
|
|
||||||
FROM busybox
|
#FROM busybox
|
||||||
WORKDIR /usr/bin/
|
#WORKDIR /usr/bin/
|
||||||
COPY --from=builder /go/bin/panelcli /usr/bin/
|
#COPY --from=builder /go/bin/panelcli /usr/bin/
|
||||||
COPY --from=builder /go/bin/userpanel /usr/bin/
|
#COPY --from=builder /go/bin/userpanel /usr/bin/
|
||||||
COPY panelui/res/ /go/src/git.lattuga.net/boyska/feedpanel/panelui/res/
|
#COPY --from=builder /go/bin/gin /usr/bin/
|
||||||
ENTRYPOINT ["./userpanel"]
|
#COPY panelui/res/ /go/src/git.lattuga.net/boyska/feedpanel/panelui/res/
|
||||||
|
#ENTRYPOINT ["/go/bin/gin", "./cmd/userpanel"]
|
||||||
|
|
|
@ -12,9 +12,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
port := os.Getenv("PORT")
|
||||||
|
if port == "" {
|
||||||
|
port = "8000"
|
||||||
|
}
|
||||||
fs := flag.NewFlagSetWithEnvPrefix(os.Args[0], "PANEL", 0)
|
fs := flag.NewFlagSetWithEnvPrefix(os.Args[0], "PANEL", 0)
|
||||||
allowedName := fs.String("allowed-name", "", "Name allowed to forward auth")
|
allowedName := fs.String("allowed-name", "", "Name allowed to forward auth")
|
||||||
addr := fs.String("listen-addr", ":8000", "Address to listen on")
|
addr := fs.String("listen-addr", ":"+port, "Address to listen on")
|
||||||
fs.Parse(os.Args[1:])
|
fs.Parse(os.Args[1:])
|
||||||
|
|
||||||
var allowedNames []string
|
var allowedNames []string
|
||||||
|
|
Reference in a new issue