FROM golang:1.23-alpine

# Install dependensi dasar
RUN apk add --no-cache git curl bash build-base

# Install Air (pakai repo baru air-verse)
RUN go install github.com/air-verse/air@v1.52.3

WORKDIR /lti-api

# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy source code
COPY . .

EXPOSE 8081

CMD ["air", "-c", ".air.toml"]
