This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# --- Builder Stage ---
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
# Arbeitsverzeichnis
|
||||
WORKDIR /app
|
||||
|
||||
# Go-Module laden
|
||||
COPY go.mod ./
|
||||
RUN go mod download
|
||||
|
||||
# Quellcode
|
||||
COPY . .
|
||||
|
||||
# Binary bauen (statisch, kleiner)
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o subnetcalc .
|
||||
|
||||
# --- Runtime Stage ---
|
||||
FROM alpine:3.22
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Binary vom Builder kopieren
|
||||
COPY --from=builder /app/subnetcalc .
|
||||
|
||||
# Exponiere Port für Webinterface
|
||||
EXPOSE 8080
|
||||
|
||||
# Standardkommando: immer Web-Modus starten
|
||||
ENTRYPOINT ["./subnetcalc", "-web", ":8080"]
|
||||
Reference in New Issue
Block a user