diff options
author | Galen Guyer <galen@galenguyer.com> | 2022-04-25 21:40:00 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2022-04-25 21:40:00 -0400 |
commit | 5b3a5a474e51e6ad8b2f1f9e44ebf0fcb96c06e5 (patch) | |
tree | eb4c5a01c963a6f978225729330c309fd35bc036 | |
parent | 6014afab0fabad2b7213fee67a1dc28257ba48e4 (diff) |
add dockerfile
-rw-r--r-- | .dockerignore | 2 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Dockerfile | 13 | ||||
-rw-r--r-- | main.go | 6 |
4 files changed, 19 insertions, 4 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3aa4c44 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.env* +clinton @@ -1,2 +1,2 @@ -.env +.env* clinton diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c22a379 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM docker.io/golang:1.18-alpine3.15 AS build + +WORKDIR /src/ +COPY . . +RUN apk add git && \ + go build -v -o vote + +FROM docker.io/alpine:3.15 +COPY static /static +COPY templates /templates +COPY --from=build /src/vote /vote + +ENTRYPOINT [ "/vote" ] @@ -27,8 +27,8 @@ func main() { os.Getenv("VOTE_JWT_SECRET"), os.Getenv("VOTE_SECRET"), os.Getenv("VOTE_HOST"), - os.Getenv("VOTE_HOST")+"auth/callback", - os.Getenv("VOTE_HOST")+"auth/login", + os.Getenv("VOTE_HOST")+"/auth/callback", + os.Getenv("VOTE_HOST")+"/auth/login", []string{"profile", "email", "groups"}, ) @@ -259,7 +259,7 @@ func main() { c.Redirect(302, "/results/"+poll.Id) })) - r.GET("/stream/:topic", broker.ServeHTTP) + r.GET("/stream/:topic", csh.AuthWrapper(broker.ServeHTTP)) go broker.Listen() |