16 lines
333 B
Docker
16 lines
333 B
Docker
|
FROM golang:1.22.0-alpine3.19 as build
|
||
|
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
COPY go.mod go.sum ./
|
||
|
RUN go mod download && go mod verify
|
||
|
|
||
|
COPY . .
|
||
|
RUN go build -v -o /tmp/app ./cmd/web
|
||
|
|
||
|
|
||
|
FROM golang:1.22.0-alpine3.19
|
||
|
ENV LOGFMT=json LOGLEVEL=DEBUG
|
||
|
COPY --from=build /tmp/app /
|
||
|
EXPOSE 4000
|
||
|
CMD ["sh", "-c", "/app -logfmt=$LOGFMT -loglevel=$LOGLEVEL"]
|