From 127299d64da50fc0e5cc5d7aaa61d0a2ef21d881 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Fri, 13 Feb 2026 12:42:49 +0300 Subject: [PATCH] add Dockerfile & Justfile --- Dockerfile | 24 ++++++++++++++++++++++++ Justfile | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100644 Justfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7da58eb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.25 AS builder + +WORKDIR /app + +RUN apt-get update && apt-get install -y \ + gcc \ + libc6-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=1 go build -ldflags="-linkmode external -extldflags '-static' -s -w" -o podcaster . + +FROM scratch + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=builder /app/podcaster /podcaster + +EXPOSE 5000 + +ENTRYPOINT ["/podcaster"] diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..bb41d4b --- /dev/null +++ b/Justfile @@ -0,0 +1,5 @@ +build: + docker build -t podcaster . + +run: + docker run -p 5000:5000 --name podcaster -v ./db:/db -v ./podcasts:/podcasts podcaster:latest