Test für Git AutoClone
All checks were successful
release-tag / release-image (push) Successful in 2m14s
All checks were successful
release-tag / release-image (push) Successful in 2m14s
This commit is contained in:
41
Dockerfile_Slim
Normal file
41
Dockerfile_Slim
Normal file
@@ -0,0 +1,41 @@
|
||||
############################
|
||||
# 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"]
|
Reference in New Issue
Block a user