Files
notely/devops/docker/Dockerfile
domrichardson 295e03feb4
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m20s
fix: removed hardcoded api url
2026-03-30 10:58:36 +01:00

40 lines
678 B
Docker

# Frontend build stage
FROM node:25-alpine AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ .
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/dist ./public
EXPOSE 8080
CMD ["./server"]