Files
yoink-go/Dockerfile
Bryan Bailey 9d1ca16704 feat(web): improve UI responsiveness, polish, and update docs
- Add mobile/tablet responsive breakpoints to web UI
- Redesign cards as full-bleed poster layout with gradient overlay
- Add skeleton loading state, comic count badge, and search icon
- Switch to Docker image format for registry compatibility
- Add docker-build and docker-push Makefile targets with versioned tags
- Update README to document web UI, Docker deployment, and serve command
2026-03-08 23:06:50 -04:00

38 lines
1.4 KiB
Docker

# ── Build stage ────────────────────────────────────────────────────────────
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22-bullseye AS builder
WORKDIR /app
# Restore modules in a separate layer so it's cached until go.mod/go.sum change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
# Copy source and build a fully static binary
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags="-s -w" -trimpath -o yoink .
# ── Runtime stage ──────────────────────────────────────────────────────────
# distroless/base-debian12:nonroot — minimal attack surface, non-root by default
FROM gcr.io/distroless/base-debian12:nonroot
LABEL org.opencontainers.image.title="yoink" \
org.opencontainers.image.description="Comic downloader web UI" \
org.opencontainers.image.source="https://git.brizzle.dev/bryan/yoink-go"
WORKDIR /app
COPY --from=builder --chown=nonroot:nonroot /app/yoink .
ENV YOINK_LIBRARY=/library
VOLUME ["/library"]
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD ["/app/yoink", "healthcheck"]
USER nonroot
CMD ["/app/yoink", "serve"]