############################ # 1) Go‑Build ############################ FROM golang:1.23.1 AS build WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 go build -o /blog ./cmd/blog ############################ # 3) Runtime‑Image ############################ FROM debian:bookworm-slim # (optional) MySQL‑Client für später RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates git \ && rm -rf /var/lib/apt/lists/* # ─── Binärdatei ───── COPY --from=build /blog /usr/local/bin/blog # ─── Content + Assets ─── RUN mkdir -p /content /static /pages /app /templates /ticks /git-temp COPY . /app ENV BLOG_CONTENT_DIR=/content ENV BLOG_STATIC_DIR=/static ENV BLOG_PAGES_DIR=/pages ENV BLOG_TEMPLATES_DIR=/templates ENV BLOG_TICKS_DIR=/ticks ENV GIT_ENABLE=false ENV GIT_REPO=null ENV GIT_BRANCH=main ENV GIT_DIR=/git-temp ENV GIT_INTERVAL=10 EXPOSE 8080 CMD ["blog"]