FROM golang:1.24.2

WORKDIR /app

RUN useradd runner -r -u 1001 -d /app
RUN chown -R runner:runner /app
USER runner

COPY *.mod    ./
COPY *.sum    ./

RUN go mod download

COPY *.go      ./
COPY Makefile  ./
COPY lib       ./lib
COPY log       ./log
COPY public    ./public
COPY routes    ./routes
COPY templates ./templates

RUN make

ENTRYPOINT ["/app/website"]
