🚀 add web dockerfile

This commit is contained in:
Ruidy 2022-06-08 23:49:19 +02:00
parent e28df4b158
commit e0b2c809aa
2 changed files with 26 additions and 2 deletions

View file

@ -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

22
Dockerfile.web Normal file
View file

@ -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"]