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.
23 lines
632 B
23 lines
632 B
## 1. Build Frontend
|
|
FROM node:20-bookworm AS build-frontend
|
|
WORKDIR /project
|
|
COPY . .
|
|
ENV CGO_ENABLED 0
|
|
RUN cd frontend && npm install && rm -rf ./build && npm run build
|
|
|
|
## 2. Build server
|
|
FROM golang:1.20 AS build-server
|
|
WORKDIR /project
|
|
COPY . .
|
|
COPY --from=build-frontend /project/frontend/build /project/frontend/build
|
|
ENV CGO_ENABLED 0
|
|
RUN go mod download
|
|
RUN go build -ldflags "-w -s" -o /build/lucifer4 cmd/lucifer4-server/main.go
|
|
|
|
## 3. Run server
|
|
FROM alpine:3.18.4
|
|
# Add results from previous builds
|
|
COPY --from=build-server /build/lucifer4 /usr/local/bin/lucifer4
|
|
RUN apk add --no-cache tzdata
|
|
# Run server
|
|
CMD lucifer4
|