From 78ad0fbf27b1df8fd2ca79e935c2ef555ed79d70 Mon Sep 17 00:00:00 2001 From: unintendedfraud Date: Sun, 13 Aug 2023 01:39:30 +0200 Subject: [PATCH] rename env variables --- Dockerfile | 20 ++++++++++++++++++++ env/main.go | 8 ++++---- main.go | 1 - openai/client.go | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78bb88a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM golang:1.21.0 + +# Creates an app directory to hold your app’s source code +WORKDIR /app + +# Copies everything from your root directory into /app +COPY . . + +# Installs Go dependencies +RUN go mod download + +# Builds your app with optional configuration +RUN go build + +# Tells Docker which network port your container listens on +EXPOSE 8080 + +# Specifies the executable command that runs when the container starts +CMD [ “/hal” ] + diff --git a/env/main.go b/env/main.go index 4be5b33..8fc06a3 100644 --- a/env/main.go +++ b/env/main.go @@ -17,10 +17,10 @@ func GetEnvVariables() Env { } return Env{ - AppID: tempest.StringToSnowflake(os.Getenv("APP_ID")), - PublicKey: os.Getenv("PUBLIC_KEY"), - Token: os.Getenv("TOKEN"), - Port: "8080", + AppID: tempest.StringToSnowflake(os.Getenv("HAL_APP_ID")), + PublicKey: os.Getenv("HAL_PUBLIC_KEY"), + Token: os.Getenv("HAL_TOKEN"), + Port: os.Getenv("PORT"), Addr: os.Getenv("ADDR"), ServerIDs: serverIDs, OpenaiHalToken: os.Getenv("OPENAI_HAL"), diff --git a/main.go b/main.go index 7cb860e..d977ea8 100644 --- a/main.go +++ b/main.go @@ -72,7 +72,6 @@ func main() { if err := client.ListenAndServe(addr); err != nil { panic(err) } - } func initialize(c tempest.Client, serverIDs []tempest.Snowflake) error { diff --git a/openai/client.go b/openai/client.go index 8788a72..8bf25b8 100644 --- a/openai/client.go +++ b/openai/client.go @@ -5,7 +5,7 @@ import ( "fmt" "regexp" - "github.com/go-resty/resty/v2" + resty "github.com/go-resty/resty/v2" ) type Client struct {