Files
nuyue/Dockerfile.manual
admin d3f74112e6
Build and Push / build (push) Failing after 13s
Docker Build / Build and Push Docker Image (push) Failing after 11s
fix: restore Dockerfile and fix CI workflow with frontend build
2026-06-23 10:41:22 +00:00

44 lines
913 B
Docker

# Build frontend
FROM node:20-alpine AS frontend
WORKDIR /app/web
COPY web/package*.json ./
RUN npm ci
COPY web/ ./
RUN npm run build
# Build backend
FROM golang:1.24-alpine AS backend
ENV GOTOOLCHAIN=auto
RUN apk add --no-cache git gcc musl-dev
WORKDIR /app/server
COPY server/go.mod server/go.sum ./
RUN go mod download
COPY server/ ./
COPY agent/ ../agent/
# Copy frontend build
COPY --from=frontend /app/web/dist ./embed/dist
# Build server
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o /nuyue-server ./cmd/server
# Build agent
RUN cd ../agent && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-agent ./cmd/agent
# Runtime
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=backend /nuyue-server /app/
COPY --from=backend /nuyue-agent /app/
COPY --from=frontend /app/web/dist /app/embed/dist
EXPOSE 8080 9090
CMD ["/app/nuyue-server"]