From 0216f9dd7ffd9bd785816b4ad07cc2d894b7d6fb Mon Sep 17 00:00:00 2001 From: maxprilutskiy Date: Mon, 2 Sep 2024 15:55:16 +0200 Subject: [PATCH] chore: fix --- action/Dockerfile | 18 ++++++++---------- action/entrypoint.sh | 13 ++++++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/action/Dockerfile b/action/Dockerfile index 4b9cb44..bd54e96 100644 --- a/action/Dockerfile +++ b/action/Dockerfile @@ -1,16 +1,14 @@ -FROM node:14 +FROM node:20.12.2-alpine -# Create and change to the app directory +# Set working directory WORKDIR /usr/src/app -# Copy package.json and package-lock.json -COPY package*.json ./ +# Copy necessary files +COPY package*.json index.mjs entrypoint.sh ./ -# Install dependencies -RUN npm install +# Install pnpm and dependencies +RUN npm install -g pnpm && pnpm install -# Copy the rest of the application code -COPY . . - -# Run the entrypoint script +# Make entrypoint.sh executable and set as entrypoint +RUN chmod +x entrypoint.sh ENTRYPOINT ["./entrypoint.sh"] diff --git a/action/entrypoint.sh b/action/entrypoint.sh index 79bfa8c..e9e898a 100755 --- a/action/entrypoint.sh +++ b/action/entrypoint.sh @@ -1,7 +1,10 @@ -#!/bin/sh -l +#!/bin/sh -# Install dependencies -npm install +# Exit immediately if a command exits with a non-zero status +set -e -# Execute the main script -node index.mjs +# Print all executed commands to the terminal +set -x + +# Start the Node.js application +exec node index.mjs