Skip to content

Commit

Permalink
feat: added nodejs22
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Jan 16, 2025
1 parent dc97a2a commit 31deb13
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
44 changes: 44 additions & 0 deletions 22.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM node:22-alpine


# * Same version as in Watchtower
ARG EXPRESS_VERSION=4.18.2
ENV EXPRESS_VERSION $EXPRESS_VERSION

# * path to the server files
ARG SERVER_PATH /opt/server
ENV SERVER_PATH=$SERVER_PATH

# * Required to access to the globally installed modules
ENV NODE_PATH=/usr/local/lib/node_modules

# * Add path to the stored pnpm packages
ENV PNPM_HOME=/root/.local/share/pnpm
ENV PATH=$PATH:$PNPM_HOME

# * Directory where the Nhost project is located
ENV NHOST_PROJECT_PATH=/opt/project

# * Default package manager
ENV PACKAGE_MANAGER=pnpm

# * Use a custom Typescript compiler rather than the one from the project
ENV SWC_NODE_PROJECT $SERVER_PATH/tsconfig.json

# install dependencies
RUN apk update && apk upgrade && \
apk add --no-cache git openssh python3 make g++

# * Install packages that are required for this docker image to run
RUN npm install -g pnpm nodemon express@$EXPRESS_VERSION morgan [email protected] tsx @antfu/ni

# * The pnpm store should be mounted in the same volume as node_modules (requires hard links)
# * See https://pnpm.io/6.x/npmrc#store-dir
RUN pnpm config set store-dir $NHOST_PROJECT_PATH/node_modules/.pnpm-store

# * Copy server files
COPY nodemon.json start.sh server.ts tsconfig.json $SERVER_PATH/

# * Change working directory to the Nhost project directory
WORKDIR $NHOST_PROJECT_PATH
ENTRYPOINT $SERVER_PATH/start.sh
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31deb13

Please sign in to comment.