FROM golang:1.23.3-alpine WORKDIR /app # Install build dependencies and air RUN apk add --no-cache git make && \ go install github.com/cosmtrek/air@v1.49.0 # Sao chép file go.mod và go.sum COPY go.mod go.sum ./ # Tải các dependency RUN go mod download # Sao chép file .air.toml COPY .air.toml ./ # Sao chép toàn bộ mã nguồn COPY . . # Expose port ARG PORT=8080 ENV PORT=${PORT} EXPOSE ${PORT} # Chạy Air để hot-reload CMD ["air"]