FROM golang:1.26-alpine3.23

WORKDIR /tinyauth

COPY go.mod ./
COPY go.sum ./

RUN go mod download

RUN go install github.com/air-verse/air@v1.61.7
RUN go install github.com/go-delve/delve/cmd/dlv@v1.26.3

COPY ./cmd ./cmd
COPY ./internal ./internal
COPY ./pkg ./pkg
COPY ./air.toml ./

EXPOSE 3000

ENV TINYAUTH_DATABASE_PATH=/data/tinyauth.db

ENV TINYAUTH_RESOURCES_PATH=/data/resources

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