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.

22 lines
632 B

7 months ago
7 months ago
7 months ago
  1. ## 1. Build Frontend
  2. FROM node:20-bookworm AS build-frontend
  3. WORKDIR /project
  4. COPY . .
  5. ENV CGO_ENABLED 0
  6. RUN cd frontend && npm install && rm -rf ./build && npm run build
  7. ## 2. Build server
  8. FROM golang:1.20 AS build-server
  9. WORKDIR /project
  10. COPY . .
  11. COPY --from=build-frontend /project/frontend/build /project/frontend/build
  12. ENV CGO_ENABLED 0
  13. RUN go mod download
  14. RUN go build -ldflags "-w -s" -o /build/lucifer4 cmd/lucifer4-server/main.go
  15. ## 3. Run server
  16. FROM alpine:3.18.4
  17. # Add results from previous builds
  18. COPY --from=build-server /build/lucifer4 /usr/local/bin/lucifer4
  19. RUN apk add --no-cache tzdata
  20. # Run server
  21. CMD lucifer4