github.com/popeskul/qna-go@v0.0.0-20230109215716-6e2a125005c8/Dockerfile (about)

     1  FROM golang:1.18-alpine3.16 AS builder
     2  
     3  WORKDIR /app
     4  COPY . .
     5  
     6  RUN GOOS=linux go build -o ./bin/app ./cmd/main.go
     7  
     8  # Run stage
     9  FROM alpine:latest AS runner
    10  
    11  COPY --from=builder /app/bin/app/ .
    12  COPY --from=builder /app/.env .
    13  COPY --from=builder /app/configs ./configs
    14  
    15  EXPOSE 8080
    16  CMD ["./app"]