Skip to content

Commit 298ba9a

Browse files
committed
feat: add base dockerfile and workflows
1 parent 05b7bfa commit 298ba9a

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Container Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
docker_test:
9+
timeout-minutes: 30
10+
permissions:
11+
id-token: write
12+
contents: read
13+
runs-on: ubuntu-latest
14+
name: integration testing in docker compose
15+
defaults:
16+
run:
17+
shell: bash --noprofile --norc -eo pipefail -x {0}
18+
19+
env:
20+
DOCKER_BUILDKIT: "1"
21+
22+
strategy:
23+
fail-fast: false
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Run docker build
30+
run: |
31+
docker build . -t cognition --build-arg NPM_TOKEN=${{ secrets.CEREBRUM_NPM_TOKEN }}
32+
33+
- name: Smoke test
34+
run: |
35+
docker run -d -p 3000:3000 cognition
36+
sleep 30
37+
if [ "$(curl -s -o /dev/null -w "%{http_code}" localhost:3000/orders)" != "200" ]; then
38+
echo "Smoke test failed. Non-200 response received."
39+
exit 1
40+
fi
41+
docker stop $(docker ps -q --filter ancestor=cognition)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Automate generation of release PRs using Conventional Commits
2+
# See https://github.com/googleapis/release-please
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
name: release-please
11+
jobs:
12+
release-please:
13+
timeout-minutes: 30
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.GHA_NODEJS_TOKEN }}
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# =========================
2+
# Production Stage (Debian 13 "trixie")
3+
# =========================
4+
FROM node:22.21.1-trixie-slim AS runtime
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# System + app deps (no Chrome deps — Playwright handles those)
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
ca-certificates curl bash openssl \
10+
ghostscript libopenjp2-7 \
11+
ffmpeg \
12+
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
13+
gstreamer1.0-plugins-bad gstreamer1.0-nice \
14+
gstreamer1.0-tools \
15+
fonts-liberation fonts-dejavu-core \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
WORKDIR /usr/api
19+
20+
# Playwright env
21+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
22+
23+
# Let Playwright handle browser deps + Chromium itself
24+
RUN npx --yes playwright install --with-deps chromium

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# node-playwright-base-image
2+
3+
This is a base image for running Playwright with Node.js 22 on Debian 13 "trixie-slim". It includes all necessary dependencies for running Playwright with Chromium.

release-please-config.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"changelog-sections": [
3+
{
4+
"type": "feat",
5+
"section": "Features"
6+
},
7+
{
8+
"type": "fix",
9+
"section": "Bug Fixes"
10+
},
11+
{
12+
"type": "perf",
13+
"section": "Performance Improvements"
14+
},
15+
{
16+
"type": "docs",
17+
"section": "Documentation",
18+
"hidden": false
19+
},
20+
{
21+
"type": "style",
22+
"section": "Styles",
23+
"hidden": false
24+
},
25+
{
26+
"type": "refactor",
27+
"section": "Code Refactoring",
28+
"hidden": false
29+
},
30+
{
31+
"type": "test",
32+
"section": "Tests",
33+
"hidden": false
34+
},
35+
{
36+
"type": "build",
37+
"section": "Build System",
38+
"hidden": false
39+
},
40+
{
41+
"type": "ci",
42+
"section": "Continuous Integration",
43+
"hidden": false
44+
},
45+
{
46+
"type": "chore",
47+
"section": "Miscellaneous Chores",
48+
"hidden": false
49+
},
50+
{
51+
"type": "revert",
52+
"section": "Reverts"
53+
}
54+
],
55+
"packages": {
56+
".": {
57+
"release-type": "simple"
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)