Files
domrichardson ead8219f3b
Build and Push App Image / build-and-push (push) Successful in 3m38s
new frontend
2026-06-17 12:08:20 +01:00

40 lines
693 B
Docker

# Frontend build stage
FROM node:25-alpine AS frontend-builder
WORKDIR /frontend_new
COPY frontend_new/package*.json ./
RUN npm install
COPY frontend_new/ .
RUN npm run build
# Backend build stage
FROM golang:1.26-alpine AS backend-builder
WORKDIR /app
RUN apk add --no-cache git
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend/ .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server ./cmd/server/main.go
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=backend-builder /app/server .
COPY --from=frontend-builder /frontend_new/out ./public
EXPOSE 8080
CMD ["./server"]