bump go to 1.22.0; add container setup
use a multistage build so we don't leave the source code on the final artifact.
This commit is contained in:
parent
9c857694ab
commit
5a5d8b7909
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
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"]
|
Loading…
Reference in New Issue
Block a user