Passt so
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal 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"]
|
||||
|
Reference in New Issue
Block a user