ci: fix few Docker issues and use multi stage builds for a lighter image
This commit is contained in:
17
Dockerfile
17
Dockerfile
@ -1,4 +1,6 @@
|
||||
FROM golang:1.19.4-alpine3.17
|
||||
FROM golang:1.22.1-alpine3.19 as build
|
||||
|
||||
RUN apk add make git
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
@ -8,6 +10,17 @@ RUN go mod download
|
||||
COPY . .
|
||||
RUN make build
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN adduser user -D
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user/dumb
|
||||
|
||||
COPY --from=build /code/dumb .
|
||||
COPY --from=build /code/static static
|
||||
|
||||
EXPOSE 5555/tcp
|
||||
|
||||
CMD ["/code/dumb"]
|
||||
CMD ["./dumb"]
|
||||
|
||||
|
Reference in New Issue
Block a user