First commit

This commit is contained in:
2025-05-09 04:43:15 +00:00
commit 7d1c046145
9 changed files with 384 additions and 0 deletions

33
Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# Dockerfile for Matrix GPT Bot
# --- Build Stage ---
FROM golang:1.24-alpine AS builder
# Install git for module downloads
RUN apk add --no-cache git
WORKDIR /app
# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source
COPY . .
# Build the binary
RUN go build -o matrix-gpt-bot ./main.go
# --- Final Stage ---
FROM alpine:3.18
# Install CA certificates
RUN apk add --no-cache ca-certificates
WORKDIR /root/
# Copy the built binary from the builder stage
COPY --from=builder /app/matrix-gpt-bot .
# Define the entrypoint
ENTRYPOINT ["./matrix-gpt-bot"]