25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
367 B

  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.19
  3. WORKDIR /app
  4. COPY go.mod go.sum ./
  5. RUN go mod download
  6. COPY . .
  7. RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /app/app ./cmd/app
  8. # Second stage: use a minimal image
  9. FROM alpine:latest
  10. WORKDIR /
  11. RUN apk add --no-cache ca-certificates
  12. COPY --from=builder /app/app /app
  13. EXPOSE 8080
  14. ENTRYPOINT ["/app"]