diff --git a/modules/ecash-lib/.dockerignore b/modules/ecash-lib/.dockerignore new file mode 100644 --- /dev/null +++ b/modules/ecash-lib/.dockerignore @@ -0,0 +1 @@ +node_modules/ diff --git a/modules/ecash-lib/Dockerfile b/modules/ecash-lib/Dockerfile new file mode 100644 --- /dev/null +++ b/modules/ecash-lib/Dockerfile @@ -0,0 +1,24 @@ +# Node image for publishing ecash-lib +# Note: ecash-lib-wasm must be built and in place before this is run + +FROM node:20-buster-slim + +# Install some dependencies before building +RUN apt-get update && apt-get upgrade -y + +WORKDIR /app + +# Copy only the package files and install necessary dependencies. +# This reduces cache busting when source files are changed. +COPY package.json . +COPY package-lock.json . +RUN npm ci + +# Copy the rest of the project files +COPY . . + +# Compile typescript. Outputs to dist/ dir +RUN npm run build + +# Publish the module +CMD [ "npm", "publish" ]