35 lines
557 B
Docker
35 lines
557 B
Docker
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /build
|
|
COPY ./web .
|
|
RUN npm install
|
|
RUN npm run build
|
|
|
|
|
|
FROM golang:alpine AS builder2
|
|
|
|
ENV GO111MODULE=on \
|
|
CGO_ENABLED=0 \
|
|
GOOS=linux
|
|
|
|
WORKDIR /build
|
|
|
|
ADD go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
COPY --from=builder /build/dist ./web/dist
|
|
RUN go build -ldflags "-s -w " -o gpt-load
|
|
|
|
|
|
FROM alpine
|
|
|
|
WORKDIR /app
|
|
RUN apk upgrade --no-cache \
|
|
&& apk add --no-cache ca-certificates tzdata \
|
|
&& update-ca-certificates
|
|
|
|
COPY --from=builder2 /build/gpt-load .
|
|
EXPOSE 3000
|
|
ENTRYPOINT ["/app/gpt-load"]
|