-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 999 Bytes
/
Copy pathDockerfile
File metadata and controls
24 lines (17 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# ── build stage ───────────────────────────────────────────────────────────────
FROM golang:1.26-alpine AS builder
WORKDIR /app
# Cache module downloads separately from source.
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o expense-bot ./cmd/bot
# ── final stage ───────────────────────────────────────────────────────────────
FROM alpine:3.19
# ca-certificates needed for HTTPS calls to Google / Telegram APIs.
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/expense-bot .
# On Render: all config comes from env vars (BOT_TOKEN, SPREADSHEET_ID, etc.)
# Locally: mount config.json + credentials.json into /app/
CMD ["./expense-bot"]