mirror of
https://github.com/the-programmers-hangout/swiftspiracy-bot.git
synced 2026-09-04 01:06:01 +02:00
Merge pull request #7 from the-programmers-hangout/chore/improve-docker-build
Chore/improve docker build
This commit is contained in:
+2
-1
@@ -5,7 +5,8 @@ DISCORD_CHANNEL_ID=your-channel-id-here
|
|||||||
# Timing configuration
|
# Timing configuration
|
||||||
SEND_MESSAGE_INTERVAL_MIN=5
|
SEND_MESSAGE_INTERVAL_MIN=5
|
||||||
SEND_MESSAGE_INTERVAL_MAX=10
|
SEND_MESSAGE_INTERVAL_MAX=10
|
||||||
SEND_MESSAGE_UNIT=second # "second" | "seconds" | "minute" | "minutes" | "millisecond" | "milliseconds"
|
# "second" | "seconds" | "minute" | "minutes" | "millisecond" | "milliseconds"
|
||||||
|
SEND_MESSAGE_UNIT=second
|
||||||
|
|
||||||
# Delay before deleting a conspiracy message (eg "3s", "500ms", "1m")
|
# Delay before deleting a conspiracy message (eg "3s", "500ms", "1m")
|
||||||
DELETE_CONSPIRACY_DELAY=3s
|
DELETE_CONSPIRACY_DELAY=3s
|
||||||
|
|||||||
+11
-6
@@ -1,10 +1,15 @@
|
|||||||
FROM golang:alpine AS builder
|
FROM golang:alpine AS builder
|
||||||
RUN apk --update add ca-certificates
|
RUN apk --update add ca-certificates git make bash
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
RUN go mod tidy
|
RUN go mod tidy
|
||||||
ENV DISCORD_BOT_TOKEN=""
|
RUN make bot
|
||||||
ENV GIT_COMMIT=""
|
|
||||||
ENV BUILD_DATE=""
|
FROM alpine
|
||||||
RUN go build -ldflags="-s -w -X main.CommitHash=$GIT_COMMIT -X main.BuildDate=$BUILD_DATE" -o bin/swiftspiracybot cmd/bot/main.go
|
RUN apk --no-cache add ca-certificates
|
||||||
ENTRYPOINT ["bin/swiftspiracybot"]
|
|
||||||
|
COPY --from=builder /app/bin/bot /bot
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bot"]
|
||||||
|
|||||||
Reference in New Issue
Block a user