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