From b36fd1dba4ed0715d03b498f259b588c06a326da Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sat, 27 May 2023 11:52:47 -0500 Subject: [PATCH] update dockerfile --- Dockerfile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 196db39..ffffea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,20 @@ -FROM golang:latest +FROM registry.durp.info/golang:1.20-alpine + +RUN chmod -R o=,g=rwX /go +RUN mkdir /app + +RUN adduser \ +--disabled-password \ +--gecos "" \ +--home "/nonexistent" \ +--shell "/sbin/nologin" \ +--no-create-home \ +--uid "10001" \ +"durp" -# Set the working directory WORKDIR /app +COPY ./output/* . +RUN chown -R durp /app -# Copy the source code into the container -COPY . . - -# Build the Go binary -RUN go build -o bot - -# Set the DISCORD_BOT_TOKEN environment variable -ENV TOKEN=${TOKEN} -ENV BOTPREFIX=${BOTPREFIX} -ENV ChannelID=${ChannelID} -ENV OPENAI_API_KEY=${OPENAI_API_KEY} - -# Run the bot binary -CMD ["./bot"] \ No newline at end of file +USER durp +CMD ["./main"]