mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 12:22:17 +01:00
feat(main): add dedicated Go entrypoints for libreoffice / chromium only variants
This commit is contained in:
@@ -49,7 +49,9 @@ RUN go mod download &&\
|
|||||||
COPY cmd ./cmd
|
COPY cmd ./cmd
|
||||||
COPY pkg ./pkg
|
COPY pkg ./pkg
|
||||||
|
|
||||||
RUN go build -o gotenberg -ldflags "-s -w -X 'github.com/gotenberg/gotenberg/v8/cmd.Version=$GOTENBERG_VERSION'" cmd/gotenberg/main.go
|
RUN go build -o gotenberg -ldflags "-s -w -X 'github.com/gotenberg/gotenberg/v8/cmd.Version=$GOTENBERG_VERSION'" cmd/gotenberg/main.go &&\
|
||||||
|
go build -o gotenberg-chromium -ldflags "-s -w -X 'github.com/gotenberg/gotenberg/v8/cmd.Version=$GOTENBERG_VERSION'" cmd/gotenberg-chromium/main.go &&\
|
||||||
|
go build -o gotenberg-libreoffice -ldflags "-s -w -X 'github.com/gotenberg/gotenberg/v8/cmd.Version=$GOTENBERG_VERSION'" cmd/gotenberg-libreoffice/main.go
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Custom JRE stage
|
# Custom JRE stage
|
||||||
@@ -168,9 +170,8 @@ RUN \
|
|||||||
# https://github.com/arachnys/athenapdf/commit/ba25a8d80a25d08d58865519c4cd8756dc9a336d.
|
# https://github.com/arachnys/athenapdf/commit/ba25a8d80a25d08d58865519c4cd8756dc9a336d.
|
||||||
COPY --link build/fonts.conf /etc/fonts/conf.d/100-gotenberg.conf
|
COPY --link build/fonts.conf /etc/fonts/conf.d/100-gotenberg.conf
|
||||||
|
|
||||||
# Copy the Golang binaries.
|
# Copy the pdfcpu binary (shared across all variants).
|
||||||
COPY --link --from=pdfcpu-binary-stage /home/pdfcpu /usr/bin/
|
COPY --link --from=pdfcpu-binary-stage /home/pdfcpu /usr/bin/
|
||||||
COPY --link --from=gotenberg-binary-stage /home/gotenberg /usr/bin/
|
|
||||||
|
|
||||||
# Set default characterset encoding to UTF-8.
|
# Set default characterset encoding to UTF-8.
|
||||||
# See:
|
# See:
|
||||||
@@ -199,6 +200,9 @@ ARG GOTENBERG_VERSION=snapshot
|
|||||||
ARG GOTENBERG_USER_GID=1001
|
ARG GOTENBERG_USER_GID=1001
|
||||||
ARG GOTENBERG_USER_UID=1001
|
ARG GOTENBERG_USER_UID=1001
|
||||||
|
|
||||||
|
# Copy the Gotenberg binary (full variant with all modules).
|
||||||
|
COPY --link --from=gotenberg-binary-stage /home/gotenberg /usr/bin/
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="Gotenberg" \
|
LABEL org.opencontainers.image.title="Gotenberg" \
|
||||||
org.opencontainers.image.description="A containerized API for seamless PDF conversion." \
|
org.opencontainers.image.description="A containerized API for seamless PDF conversion." \
|
||||||
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
||||||
@@ -265,6 +269,9 @@ ARG GOTENBERG_VERSION=snapshot
|
|||||||
ARG GOTENBERG_USER_GID=1001
|
ARG GOTENBERG_USER_GID=1001
|
||||||
ARG GOTENBERG_USER_UID=1001
|
ARG GOTENBERG_USER_UID=1001
|
||||||
|
|
||||||
|
# Copy the Gotenberg binary (Chromium variant — no LibreOffice modules).
|
||||||
|
COPY --link --from=gotenberg-binary-stage /home/gotenberg-chromium /usr/bin/gotenberg
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="Gotenberg (Chromium)" \
|
LABEL org.opencontainers.image.title="Gotenberg (Chromium)" \
|
||||||
org.opencontainers.image.description="A containerized API for seamless PDF conversion — Chromium variant." \
|
org.opencontainers.image.description="A containerized API for seamless PDF conversion — Chromium variant." \
|
||||||
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
||||||
@@ -303,6 +310,9 @@ FROM common-stage AS gotenberg-libreoffice
|
|||||||
|
|
||||||
ARG GOTENBERG_VERSION=snapshot
|
ARG GOTENBERG_VERSION=snapshot
|
||||||
|
|
||||||
|
# Copy the Gotenberg binary (LibreOffice variant — no Chromium modules).
|
||||||
|
COPY --link --from=gotenberg-binary-stage /home/gotenberg-libreoffice /usr/bin/gotenberg
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="Gotenberg (LibreOffice)" \
|
LABEL org.opencontainers.image.title="Gotenberg (LibreOffice)" \
|
||||||
org.opencontainers.image.description="A containerized API for seamless PDF conversion — LibreOffice variant." \
|
org.opencontainers.image.description="A containerized API for seamless PDF conversion — LibreOffice variant." \
|
||||||
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
org.opencontainers.image.version="$GOTENBERG_VERSION" \
|
||||||
|
|||||||
11
cmd/gotenberg-chromium/main.go
Normal file
11
cmd/gotenberg-chromium/main.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
gotenbergcmd "github.com/gotenberg/gotenberg/v8/cmd"
|
||||||
|
// Gotenberg modules (Chromium variant — no LibreOffice).
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/standard/chromium"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
gotenbergcmd.Run()
|
||||||
|
}
|
||||||
11
cmd/gotenberg-libreoffice/main.go
Normal file
11
cmd/gotenberg-libreoffice/main.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
gotenbergcmd "github.com/gotenberg/gotenberg/v8/cmd"
|
||||||
|
// Gotenberg modules (LibreOffice variant — no Chromium).
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/standard/libreoffice"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
gotenbergcmd.Run()
|
||||||
|
}
|
||||||
3
pkg/standard/chromium/doc.go
Normal file
3
pkg/standard/chromium/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// Package chromium imports the application's modules for the Chromium-only
|
||||||
|
// variant (no LibreOffice).
|
||||||
|
package chromium
|
||||||
14
pkg/standard/chromium/imports.go
Normal file
14
pkg/standard/chromium/imports.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package chromium
|
||||||
|
|
||||||
|
import (
|
||||||
|
// Gotenberg modules (Chromium variant — no LibreOffice).
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/api"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/chromium"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/exiftool"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdfcpu"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdfengines"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdftk"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/prometheus"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/qpdf"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/webhook"
|
||||||
|
)
|
||||||
3
pkg/standard/libreoffice/doc.go
Normal file
3
pkg/standard/libreoffice/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// Package libreoffice imports the application's modules for the
|
||||||
|
// LibreOffice-only variant (no Chromium).
|
||||||
|
package libreoffice
|
||||||
16
pkg/standard/libreoffice/imports.go
Normal file
16
pkg/standard/libreoffice/imports.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package libreoffice
|
||||||
|
|
||||||
|
import (
|
||||||
|
// Gotenberg modules (LibreOffice variant — no Chromium).
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/api"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/exiftool"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/libreoffice"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/libreoffice/api"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/libreoffice/pdfengine"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdfcpu"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdfengines"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/pdftk"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/prometheus"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/qpdf"
|
||||||
|
_ "github.com/gotenberg/gotenberg/v8/pkg/modules/webhook"
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user