Skip to content

Commit f02e1b9

Browse files
committed
Docker base images
Signed-off-by: Andrey Sobolev <[email protected]>
1 parent 7702c5e commit f02e1b9

File tree

6 files changed

+110
-0
lines changed

6 files changed

+110
-0
lines changed

.github/workflows/baseimage.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
# Triggers the workflow on push or pull request events but only for the main branch
12+
push:
13+
branches: []
14+
pull_request:
15+
branches: []
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
21+
jobs:
22+
docker-build:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 60
25+
steps:
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
- name: Configure docker
29+
uses: crazy-max/ghaction-setup-docker@v3
30+
with:
31+
daemon-config: |
32+
{
33+
"features": {
34+
"containerd-snapshotter": true
35+
}
36+
}
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 1
40+
filter: tree:0
41+
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version-file: '.nvmrc'
45+
- uses: pnpm/action-setup@v4
46+
with:
47+
version: latest
48+
- name: Docker build
49+
run: |
50+
cd ./dev/base-image
51+
build.sh
52+
env:
53+
DOCKER_CLI_HINTS: false
54+
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: hardcoreeng
59+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
60+
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/s') }}
61+
run: |
62+
echo Pushing base image
63+
cd ./dev/base-image
64+
publish.sh
65+

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 [email protected] [email protected] --unsafe-perm

0 commit comments

Comments
 (0)