From d01c975f5a58b7c61e7e296f42da643960eec53c Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 26 Oct 2021 22:20:10 +0800 Subject: [PATCH] update default config and create Dockerfile --- Dockerfile | 22 ++++++++++++++++++++++ main.go | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8503468 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM golang:alpine as builder + +RUN apk add --no-cache \ + git + +WORKDIR /app + +ARG COMMIT=latest + +RUN GOBIN=/app go install git.siteop.biz/chtwrs/chirpnest@$COMMIT + +FROM alpine:latest + +RUN apk add --no-cache \ + libstdc++ + +WORKDIR /app/ + +# Copy the Pre-built binary file from the previous stage +COPY --from=builder /app/chirpnest . +# Command to run the executable +CMD ["./chirpnest"] diff --git a/main.go b/main.go index 82492b3..a1a4ba5 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ import ( ) var ( - config = flag.String("config", "config.json", "config file path") + config = flag.String("config", "./data/config.json", "config file path") initdb = flag.Bool("initdb", false, "initialize bot database") githash string buildstamp string