-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48f2a21
commit 0216f9d
Showing
2 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |