-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into file_formats
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build and Push Headless Images | ||
on: | ||
schedule: | ||
- cron: 0 1 * * * | ||
push: | ||
branches-ignore: | ||
- none | ||
workflow_dispatch: null | ||
jobs: | ||
build: | ||
runs-on: linux | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: '${{ secrets.DOCKERHUB_USERNAME }}' | ||
password: '${{ secrets.DOCKERHUB_TOKEN }}' | ||
- name: Set tag name based on branch | ||
id: set_tag | ||
run: | | ||
if [[ "${{ github.ref_name }}" != "master" ]]; then | ||
GITHUB_REFNAME=${{ github.ref_name }} | ||
BRANCH_NAME=${GITHUB_REFNAME//\//_} | ||
echo "tag=-$BRANCH_NAME" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile.chromium | ||
platforms: 'linux/amd64,linux/arm/v7,linux/arm64/v8' | ||
push: true | ||
tags: 'hivesolutions/headless:chromium${{ steps.set_tag.outputs.tag }}' |
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,33 @@ | ||
FROM node:18-bookworm-slim as builder | ||
|
||
ADD app.js /app/ | ||
ADD package.json /app/ | ||
ADD lib /app/lib | ||
|
||
WORKDIR /app | ||
|
||
RUN NODE_ENV=production PUPPETEER_SKIP_CHROME_DOWNLOAD=false npm install | ||
|
||
FROM node:18-bookworm-slim | ||
|
||
LABEL version="1.0" | ||
LABEL maintainer="Hive Solutions <development@hive.pt>" | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update &&\ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y fonts-arphic-uming\ | ||
fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf\ | ||
fonts-ipafont-gothic fonts-liberation fonts-noto-cjk fonts-noto-color-emoji\ | ||
fonts-arphic-ukai ttf-wqy-zenhei ttf-wqy-microhei libxss1 dbus dbus-x11\ | ||
fontconfig chromium --no-install-recommends &&\ | ||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && apt-get clean &&\ | ||
rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt | ||
|
||
ENV HOST 0.0.0.0 | ||
ENV PORT 8080 | ||
ENV NODE_ENV production | ||
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium | ||
|
||
COPY --from=builder /app/node_modules /app/node_modules | ||
COPY --from=builder /app /app | ||
|
||
CMD ["/usr/local/bin/node", "/app/app.js"] |
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