-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (23 loc) · 820 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (23 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# ---- Build frontend ----
FROM node:22-alpine AS frontend-builder
WORKDIR /build/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# ---- Build Go backend ----
FROM golang:1.26-alpine AS backend-builder
WORKDIR /build
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend/ .
COPY --from=frontend-builder /build/frontend/dist ./frontend/dist
RUN CGO_ENABLED=0 GOOS=linux go build -o dns-firewall .
# ---- Runtime ----
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=backend-builder /build/dns-firewall .
COPY --from=backend-builder /build/frontend/dist ./frontend/dist
EXPOSE 8080 8053
CMD ["./dns-firewall", "--dns-addr", ":8053", "--api-addr", ":8080", "--frontend-dir", "/app/frontend/dist", "--db-path", "/app/dns-firewall.db"]