Skip to content

Commit ee9f6b5

Browse files
authored
Merge pull request #74 from raphapassini/feat-node-22-nginx
[Feat] Add nginx into node:22 image
2 parents fd8d58c + 22d541a commit ee9f6b5

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
strategy:
1212
matrix:
13-
version: [18, 20, 22]
13+
version: [18, 20, 22, 22-nginx]
1414
runs-on: [ubuntu-latest, buildjet-4vcpu-ubuntu-2204-arm]
1515
runs-on: ${{ matrix.runs-on }}
1616

22-nginx/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Use the base image
2+
FROM kooldev/node:22
3+
4+
RUN apk add --no-cache nginx
5+
6+
RUN mkdir -p /etc/nginx/conf.d \
7+
&& mkdir /etc/nginx/h5bp \
8+
&& cd /etc/nginx/h5bp \
9+
&& wget https://github.com/h5bp/server-configs-nginx/archive/refs/tags/3.3.0.tar.gz -O h5bp.tgz \
10+
&& tar xzvf h5bp.tgz \
11+
&& rm -f h5bp.tgz \
12+
&& mv server-configs-nginx-*/h5bp/* . \
13+
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \

22-nginx/entrypoint

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run as current user
5+
CURRENT_USER=${ASUSER:-${UID:-0}}
6+
7+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
8+
usermod -u $CURRENT_USER kool
9+
fi
10+
11+
# Run entrypoint if provided
12+
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
13+
bash $ENTRYPOINT
14+
fi
15+
16+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
17+
exec su-exec kool "$@"
18+
else
19+
exec "$@"
20+
fi

22-nginx/kool-npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scripts-prepend-node-path=true
2+
package-import-method=copy
3+
shamefully-hoist=true
4+
store-dir=/home/kool/.pnpm-store

22-nginx/root-npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scripts-prepend-node-path=true
2+
package-import-method=copy
3+
shamefully-hoist=true
4+
store-dir=/root/.pnpm-store

0 commit comments

Comments
 (0)