-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #332 by updating the pdf consumer to work with the rest of the pr…
…oject
- Loading branch information
1 parent
9c207f8
commit b1e2162
Showing
4 changed files
with
77 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
FROM golang:latest | ||
|
||
WORKDIR /playwright | ||
RUN go mod init github.com/ocurity/pdf-consumer &&\ | ||
go get -u github.com/playwright-community/playwright-go &&\ | ||
go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps | ||
# Stage 2: Build | ||
FROM golang:1.22 as builder | ||
|
||
ENV PATH="${PATH}:/go/pkg/mod/github.com/playwright-community" | ||
COPY components/consumers/pdf/pdf /playwright/pdf | ||
COPY components/consumers/pdf/default.html /playwright/default.html | ||
ENTRYPOINT ["/playwright/pdf"] | ||
# Install playwright cli with right version for later use | ||
RUN go install github.com/playwright-community/playwright-go/cmd/playwright@latest | ||
|
||
# Stage 3: Final | ||
FROM ubuntu:oracular | ||
COPY --from=builder /go/bin/playwright / | ||
RUN apt-get update && apt-get install -y ca-certificates tzdata \ | ||
# Install dependencies and all browsers (or specify one) | ||
&& /playwright install chromium --with-deps \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY components/consumers/pdf/pdf /application/pdf | ||
COPY components/consumers/pdf/default.html /application/default.html | ||
WORKDIR /application | ||
ENTRYPOINT ["/application/pdf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.PHONY: container publish | ||
|
||
CONTAINER_REPO= | ||
DRACON_VERSION= | ||
SOURCE_CODE_REPO= | ||
PRODUCER_AGGREGATOR_BASE_IMAGE=$(shell test -e .custom_image && cat .custom_image || echo "scratch") | ||
|
||
DOCKER=docker | ||
|
||
container: | ||
$(eval workdir:=$(shell mktemp -d /tmp/pdf.XXXXXX)) | ||
mkdir -p ${workdir}/components/consumers && \ | ||
cp -r ../../../bin/components/consumers/pdf ${workdir}/components/consumers && \ | ||
cp default.html ${workdir}/components/consumers/pdf && \ | ||
$(DOCKER) build --tag $(CONTAINER_REPO)/components/consumers/pdf:$(DRACON_VERSION) \ | ||
--file Dockerfile \ | ||
$$([ "${SOURCE_CODE_REPO}" != "" ] && echo "--label=org.opencontainers.image.source=${SOURCE_CODE_REPO}" ) \ | ||
${workdir} 1>&2 && \ | ||
rm -rf ${workdir} | ||
|
||
publish: | ||
$(DOCKER) push $(CONTAINER_REPO)/components/consumers/pdf:$(DRACON_VERSION) 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters