Initial commit — energy dashboard frontend (TimescaleDB + Vue/Chart.js)
This commit is contained in:
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# Stage 1: Build frontend
|
||||
FROM node:22-alpine AS frontend
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json* ./
|
||||
RUN npm install
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Build Go binary
|
||||
FROM golang:1.24-alpine AS backend
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
COPY --from=frontend /app/dist ./dist
|
||||
RUN CGO_ENABLED=0 go build -o energy-frontend .
|
||||
|
||||
# Stage 3: Minimal runtime
|
||||
FROM alpine:3.21
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=backend /app/energy-frontend .
|
||||
EXPOSE 8080
|
||||
USER nobody:nobody
|
||||
ENTRYPOINT ["./energy-frontend"]
|
||||
Reference in New Issue
Block a user