diff --git a/Dockerfile b/Dockerfile index bb4db75..d37a961 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,12 @@ COPY go.* . RUN go mod download COPY . . -RUN go build -ldflags="-s -w" -o dist +RUN go build -ldflags="-s -w" -o dist ./cmd/cli -FROM gcr.io/distroless/static +FROM alpine:latest + +RUN apk update --no-cache WORKDIR /app COPY --from=builder /app/dist /app/dist diff --git a/Dockerfile.web b/Dockerfile.web new file mode 100644 index 0000000..bb57163 --- /dev/null +++ b/Dockerfile.web @@ -0,0 +1,22 @@ +FROM golang:1.17-alpine AS builder + +ENV GOOS linux +RUN apk update --no-cache + +WORKDIR /app + +COPY go.* . +RUN go mod download + +COPY . . +RUN go build -ldflags="-s -w" -o dist ./cmd/server + + +FROM alpine:latest + +RUN apk update --no-cache + +WORKDIR /app +COPY --from=builder /app/dist /app/dist + +CMD ["./dist"] \ No newline at end of file