This commit is contained in:
2025-05-04 13:40:31 +02:00
parent afd8edaa6c
commit 92d272b36e
10 changed files with 293 additions and 0 deletions

19
Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
# --- Build step ---
FROM golang:1.22 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /blog ./cmd/blog
# --- Runtime + optional MySQL client libraries ---
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y default-mysql-client ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /blog /usr/local/bin/blog
COPY content/ /content
COPY internal/web/static/ /static
EXPOSE 8080
ENV BLOG_CONTENT_DIR=/content
ENV BLOG_STATIC_DIR=/static
CMD ["blog"]