First commit
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal 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"]
|
Reference in New Issue
Block a user