Skip to content

Commit b4c57f6

Browse files
authored
feat: added nodejs22 (#29)
* feat: added nodejs22 * asd
1 parent dc97a2a commit b4c57f6

File tree

3 files changed

+66
-12
lines changed

3 files changed

+66
-12
lines changed

.github/workflows/publish.yml

+10
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,13 @@ jobs:
5757
push: ${{ github.event_name == 'release' }}
5858
tags: "nhost/functions:20-${{ steps.set_tag.outputs.tag }}"
5959
file: 20.Dockerfile
60+
61+
- name: Build and publish to Docker Hub
62+
uses: docker/build-push-action@v2
63+
timeout-minutes: 60
64+
with:
65+
context: .
66+
platforms: linux/amd64,linux/arm64
67+
push: ${{ github.event_name == 'release' }}
68+
tags: "nhost/functions:22-${{ steps.set_tag.outputs.tag }}"
69+
file: 22.Dockerfile

22.Dockerfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM node:22-alpine
2+
3+
4+
# * Same version as in Watchtower
5+
ARG EXPRESS_VERSION=4.18.2
6+
ENV EXPRESS_VERSION $EXPRESS_VERSION
7+
8+
# * path to the server files
9+
ARG SERVER_PATH /opt/server
10+
ENV SERVER_PATH=$SERVER_PATH
11+
12+
# * Required to access to the globally installed modules
13+
ENV NODE_PATH=/usr/local/lib/node_modules
14+
15+
# * Add path to the stored pnpm packages
16+
ENV PNPM_HOME=/root/.local/share/pnpm
17+
ENV PATH=$PATH:$PNPM_HOME
18+
19+
# * Directory where the Nhost project is located
20+
ENV NHOST_PROJECT_PATH=/opt/project
21+
22+
# * Default package manager
23+
ENV PACKAGE_MANAGER=pnpm
24+
25+
# * Use a custom Typescript compiler rather than the one from the project
26+
ENV SWC_NODE_PROJECT $SERVER_PATH/tsconfig.json
27+
28+
# install dependencies
29+
RUN apk update && apk upgrade && \
30+
apk add --no-cache git openssh python3 make g++
31+
32+
# * Install packages that are required for this docker image to run
33+
RUN npm install -g pnpm nodemon express@$EXPRESS_VERSION morgan [email protected] tsx @antfu/ni
34+
35+
# * The pnpm store should be mounted in the same volume as node_modules (requires hard links)
36+
# * See https://pnpm.io/6.x/npmrc#store-dir
37+
RUN pnpm config set store-dir $NHOST_PROJECT_PATH/node_modules/.pnpm-store
38+
39+
# * Copy server files
40+
COPY nodemon.json start.sh server.ts tsconfig.json $SERVER_PATH/
41+
42+
# * Change working directory to the Nhost project directory
43+
WORKDIR $NHOST_PROJECT_PATH
44+
ENTRYPOINT $SERVER_PATH/start.sh

flake.lock

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)