mirror of
https://github.com/rjNemo/go-pass-gen
synced 2026-06-06 02:46:40 +00:00
🚀 add web dockerfile
This commit is contained in:
parent
e28df4b158
commit
e0b2c809aa
2 changed files with 26 additions and 2 deletions
|
|
@ -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
22
Dockerfile.web
Normal 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"]
|
||||
Loading…
Reference in a new issue