From d3c1c7380fcd4ed93b0e15ea31b2e3d383d24683 Mon Sep 17 00:00:00 2001 From: 2vb <2vb@protonmail.com> Date: Tue, 14 May 2024 17:20:23 -0700 Subject: [PATCH] Docker --- Dockerfile | 8 ++++++++ main.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0bfba28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.22 +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY * ./ +RUN CGO_ENABLED=0 GOOS=linux go build -o /snow +EXPOSE 3000 +CMD ["/snow"] diff --git a/main.go b/main.go index 870f51b..0b17df4 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,8 @@ package main import ( - _ "embed" "fmt" + "os" "github.com/ectrc/snow/aid" "github.com/ectrc/snow/discord" @@ -17,10 +17,10 @@ import ( "github.com/gofiber/fiber/v2" ) -//go:embed config.ini var configFile []byte func init() { + configFile, _ = os.ReadFile("config.ini"); aid.LoadConfig(configFile) var device storage.Storage switch aid.Config.Database.Type {