2025-11-20 11:08:24 +00:00
|
|
|
# Use an official Node runtime as a parent image
|
2025-11-20 14:11:07 +00:00
|
|
|
FROM node:24.11
|
2025-11-20 11:08:24 +00:00
|
|
|
|
|
|
|
|
RUN corepack enable
|
|
|
|
|
|
|
|
|
|
# Set the working directory in the container
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
2025-11-20 15:46:58 +00:00
|
|
|
# Copy the current directory contents into the container at /usr/src/app
|
2025-11-20 11:08:24 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
2025-11-20 15:46:58 +00:00
|
|
|
# Install your app dependencies using the npm binary
|
|
|
|
|
RUN yarn
|
2025-11-20 11:08:24 +00:00
|
|
|
RUN yarn build
|
|
|
|
|
|
|
|
|
|
# Install PM2 globally
|
|
|
|
|
RUN npm install pm2 -g
|
|
|
|
|
|
2025-11-20 15:46:58 +00:00
|
|
|
# Your app binds to port 3000 so you'll use the EXPOSE instruction to have it mapped by the docker daemon
|
2025-11-20 11:08:24 +00:00
|
|
|
EXPOSE 3000
|
|
|
|
|
|
2025-11-20 15:46:58 +00:00
|
|
|
# Define the runtime command to run your application
|
2025-11-20 11:08:24 +00:00
|
|
|
CMD ["pm2-runtime", "start", "npm", "--", "start"]
|