update dockerfile
This commit is contained in:
33
Dockerfile
33
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
|
WORKDIR /app
|
||||||
|
COPY ./output/* .
|
||||||
|
RUN chown -R durp /app
|
||||||
|
|
||||||
# Copy the source code into the container
|
USER durp
|
||||||
COPY . .
|
CMD ["./main"]
|
||||||
|
|
||||||
# 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"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user