ci: add docker pipeline
This commit is contained in:
+20
-3
@@ -1,10 +1,27 @@
|
||||
FROM debian:12-slim
|
||||
FROM node:24-slim AS web-builder
|
||||
WORKDIR /web
|
||||
COPY ./apps/web/ .
|
||||
RUN npm ci && npm run build
|
||||
|
||||
# FROM golang:1.24-alpine3.22 AS builder
|
||||
FROM golang:1.24-bookworm AS builder
|
||||
WORKDIR /build
|
||||
COPY apps/api/ ./api
|
||||
COPY apps/book-reaper/ ./book-reaper
|
||||
COPY --from=web-builder /web/dist ./api/web
|
||||
# RUN apk add mupdf-libs libffi-dev gcc
|
||||
RUN cd ./api && CGO_ENABLED=1 GOPROXY=goproxy.io go build --tags=fts5 -ldflags="-s -w" -o ../yabl .
|
||||
RUN cd ./book-reaper && CGO_ENABLED=1 GOPROXY=goproxy.io go build --tags=fts5 -ldflags="-s -w" -o ../book-reaper ./cmd/book-reaper
|
||||
|
||||
# FROM alpine:3.22
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./build/api/yabl /app/yabl
|
||||
COPY ./build/book-reaper/book-reaper /app/book-reaper
|
||||
COPY --from=builder /build/yabl .
|
||||
COPY --from=builder /build/book-reaper .
|
||||
|
||||
RUN chmod +x /app/yabl /app/book-reaper
|
||||
# RUN apk add mupdf-libs libffi-dev
|
||||
|
||||
ENTRYPOINT ["/app/yabl"]
|
||||
Reference in New Issue
Block a user