From 1e4c08d3afb12d940ef613cc78abbda307219e5f Mon Sep 17 00:00:00 2001 From: Fdvkey Date: Wed, 15 Jul 2026 12:36:43 +0700 Subject: [PATCH] chore: add imagemagick to docker prod image --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92e110f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Stage: build +FROM golang:1.25.5-alpine AS build + +# Install build dependencies (CGO often needed for go-sqlite3) +RUN apk add --no-cache gcc musl-dev + +WORKDIR /app + +# Download dependencies first +COPY go.mod go.sum ./ +RUN go mod download + +# Copy source code and build +COPY . . +RUN CGO_ENABLED=1 GOOS=linux go build -trimpath -ldflags="-w -s" -o /app/neo . + +# Stage: prod +FROM alpine:latest AS prod + +# Install required tools (webpmux via libwebp-tools, ffmpeg) +RUN apk add --no-cache \ + ffmpeg \ + libwebp-tools \ + imagemagick \ + ca-certificates \ + tzdata + +WORKDIR /app + +# Copy the binary from the build stage +COPY --from=build /app/neo . + +# Command to run the application +CMD ["./neo"]