FROM golang:1.25-alpine AS build

WORKDIR /app

# Modules layer
COPY go.mod go.sum ./
RUN go mod download

# Build layer
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /tg_bot .

FROM alpine:latest AS run

COPY --from=build /tg_bot /tg_bot

CMD ["/tg_bot"]