Compare commits
1 commit
main
...
experiment
Author | SHA1 | Date | |
---|---|---|---|
|
c43d0e7295 |
2 changed files with 23 additions and 3 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/zitadel/oidc/v2/example/server/exampleop"
|
||||
"github.com/zitadel/oidc/v2/example/server/storage"
|
||||
|
@ -12,8 +13,12 @@ import (
|
|||
func main() {
|
||||
//we will run on :9998
|
||||
port := "9998"
|
||||
|
||||
issuer, ok := os.LookupEnv("ISSUER")
|
||||
if !ok {
|
||||
//which gives us the issuer: http://localhost:9998/
|
||||
issuer := fmt.Sprintf("http://localhost:%s/", port)
|
||||
issuer = fmt.Sprintf("http://localhost:%s/", port)
|
||||
}
|
||||
|
||||
// the OpenIDProvider interface needs a Storage interface handling various checks and state manipulations
|
||||
// this might be the layer for accessing your database
|
||||
|
@ -26,7 +31,7 @@ func main() {
|
|||
Addr: ":" + port,
|
||||
Handler: router,
|
||||
}
|
||||
log.Printf("server listening on http://localhost:%s/", port)
|
||||
log.Printf("server listening on %s", issuer)
|
||||
log.Println("press ctrl+c to stop")
|
||||
err := server.ListenAndServe()
|
||||
if err != nil {
|
||||
|
|
15
static-op.Dockerfile
Normal file
15
static-op.Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
|||
FROM golang:latest as build
|
||||
|
||||
COPY go.mod go.sum /build/
|
||||
WORKDIR /build
|
||||
RUN go mod download -x
|
||||
|
||||
COPY . /build/
|
||||
RUN go build ./example/server
|
||||
|
||||
FROM busybox:glibc
|
||||
COPY --from=build /build/server /usr/local/bin/server
|
||||
|
||||
ENV ISSUER=http://localhost:9998/
|
||||
EXPOSE 9998
|
||||
CMD [ "/usr/local/bin/server" ]
|
Loading…
Add table
Add a link
Reference in a new issue