Skip to content

Commit 9754c5b

Browse files
committed
Docker base images
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
1 parent 7702c5e commit 9754c5b

File tree

6 files changed

+104
-0
lines changed

6 files changed

+104
-0
lines changed

.github/workflows/baseimage.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Docker base image
4+
5+
concurrency:
6+
group: 'service-base'
7+
cancel-in-progress: true
8+
9+
# Controls when the action will run.
10+
on:
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
docker-build:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 60
19+
steps:
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v3
22+
- name: Configure docker
23+
uses: crazy-max/ghaction-setup-docker@v3
24+
with:
25+
daemon-config: |
26+
{
27+
"features": {
28+
"containerd-snapshotter": true
29+
}
30+
}
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
filter: tree:0
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version-file: '.nvmrc'
39+
- uses: pnpm/action-setup@v4
40+
with:
41+
version: latest
42+
- name: Docker build
43+
run: |
44+
cd ./dev/base-image
45+
build.sh
46+
env:
47+
DOCKER_CLI_HINTS: false
48+
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
49+
- name: Login to Docker Hub
50+
uses: docker/login-action@v3
51+
with:
52+
username: hardcoreeng
53+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
54+
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }}
55+
run: |
56+
echo Pushing base image
57+
cd ./dev/base-image
58+
publish.sh
59+

dev/base-image/base.Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:22
2+
3+
RUN apt-get install libjemalloc2 dumb-init
4+
RUN apt-get clean
5+
6+
ENV LD_PRELOAD=libjemalloc.so.2
7+
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
8+
9+
WORKDIR /usr/src/app
10+
ENV NODE_ENV=production
11+
RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate snappy msgpackr msgpackr-extract --unsafe-perm

dev/base-image/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
docker build -t hardcoreeng/base -f base.Dockerfile .
4+
docker build -t hardcoreeng/rekoni-base -f rekoni.Dockerfile .
5+
docker build -t hardcoreeng/print-base -f print.Dockerfile .

dev/base-image/print.Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM hardcoreeng/base
2+
3+
# We don't need the standalone Chromium
4+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
5+
# Set executable path for puppeteer
6+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
7+
8+
# Install Chromium and fonts
9+
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md?plain=1#L397
10+
RUN apt-get update --fix-missing
11+
RUN apt-get install -y gnupg wget libxss1
12+
RUN apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf
13+
RUN apt-get install -y chromium-common/stable --no-install-recommends
14+
RUN apt-get install -y chromium/stable --no-install-recommends
15+
RUN apt-get clean

dev/base-image/push.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
docker push hardcoreeng/base
4+
docker push hardcoreeng/rekoni-base
5+
docker push hardcoreeng/print-base

dev/base-image/rekoni.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM hardcoreeng/base
2+
3+
RUN apt-get install -y \
4+
coreutils \
5+
antiword \
6+
poppler-utils \
7+
html2text \
8+
unrtf
9+
RUN npm install --ignore-scripts=false --verbose sharp@v0.30.2 pdfjs-dist@v2.12.313 --unsafe-perm

0 commit comments

Comments
 (0)