first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:40:14 +03:00
commit e04ba85564
129 changed files with 17541 additions and 0 deletions

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
ARG GO_VERSION=1.26.2
FROM golang:${GO_VERSION}-bookworm AS builder
WORKDIR /src
# bimg uses CGO and needs libvips headers while building.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
pkg-config \
libvips-dev \
&& rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o /bin/ginimageapi .
FROM debian:bookworm-slim AS runtime
WORKDIR /app
# libvips runtime is required by bimg.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libvips \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /bin/ginimageapi /app/ginimageapi
COPY --from=builder /src/static /app/static
EXPOSE 8080
CMD ["/app/ginimageapi"]