First commit
This commit is contained in:
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@ -0,0 +1,37 @@
|
||||
# Dockerfile for Matrix Sports Bot
|
||||
|
||||
# --- Build Stage ---
|
||||
FROM golang:1.20-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 source
|
||||
COPY . .
|
||||
|
||||
# Build binary
|
||||
RUN go build -o matrix-scores-bot ./main.go
|
||||
|
||||
# --- Final Stage ---
|
||||
FROM alpine:3.18
|
||||
|
||||
# Install certificates
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
# Copy the built binary
|
||||
COPY --from=builder /app/matrix-scores-bot .
|
||||
|
||||
# Expose any port if needed (Matrix client doesn't listen)
|
||||
# EXPOSE 0
|
||||
|
||||
# Set entrypoint
|
||||
ENTRYPOINT ["./matrix-scores-bot"]
|
||||
|
Reference in New Issue
Block a user