Files

23 lines
454 B
Docker
Raw Permalink Normal View History

2025-03-23 13:38:56 -04:00
FROM golang:1.24-alpine AS builder
WORKDIR /app
2025-04-08 15:21:23 -04:00
# for C stuff (CGO_ENABLED --> sqlite3)
RUN apk add --no-cache build-base
2025-03-23 13:38:56 -04:00
# Copy go.mod and go.sum to download dependencies
COPY go.mod go.sum ./
RUN go mod download
2025-04-08 15:21:23 -04:00
# Copy the rest of the code
2025-03-23 13:38:56 -04:00
COPY . .
2025-04-08 15:21:23 -04:00
RUN CGO_ENABLED=1 GOOS=linux go build -o bot .
2025-03-23 13:38:56 -04:00
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/bot .
2025-04-08 15:21:23 -04:00
# DB stuff
VOLUME /app/data
RUN mkdir -p /app/data && chmod 755 /app/data
2025-03-23 13:38:56 -04:00
CMD ["./bot"]