I want to create a docker container. I've written a Docker file like this
FROM node:12-buster
WORKDIR /opt/myapps/
COPY . /opt/myapps/
RUN apt update
RUN apt upgrade -y
RUN apt install git -y
RUN git config --global user.email "user@git.com"
RUN git config --global user.name "user"
RUN npm install -g pm2
RUN pm2-runtime main.js
RUN pm2 save
RUN chmod +x /opt/myapps/entrypoint.sh
EXPOSE 4001
CMD ["./entrypoint.sh"]
and this is my entrypoint.sh
#!/bin/bash
#node thing
npm install
#npm start
pm2-runtime main.js --exp-backoff-restart-delay=100
when I do a build it will definitely get stuck in the final process like this
Step 10/14 : RUN pm2-runtime main.js
---> Running in 6061a8236379
2021-03-09T12:38:20: PM2 log: Launching in no daemon mode
2021-03-09T12:38:20: PM2 log: App [main:0] starting in -fork mode-
2021-03-09T12:38:20: PM2 log: App [main:0] online
Server started on port :4001
the process never continued when it got there. Does anyone know why this happened? I'm quite new to the docker world