You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
465 B

3 years ago
  1. #####################
  2. ## 1. Build server ##
  3. #####################
  4. FROM golang:1.17 AS build-server
  5. WORKDIR /project
  6. COPY . .
  7. ENV CGO_ENABLED 0
  8. RUN go mod download
  9. RUN go build -ldflags "-w -s" -o /build/lucifer cmd/server/main.go
  10. ###################
  11. ## 2. Run server ##
  12. ###################
  13. FROM alpine:3.14.2
  14. # Add results from previous builds
  15. COPY --from=build-server /build/lucifer /usr/bin/lucifer
  16. RUN apk add --no-cache tzdata
  17. # Run server
  18. CMD lucifer