I have a node.js script that when it's executed it just run a process to copy two tables from one database to another one. If I run it in my local it works as it should, so there is no coding issue. My problem is, I want to put that node.js program inside a docker image and execute that image (and the node.js script) when I needed. I created the image but when I run it just say that was executed x amount of time ago, but it doesn't do what the script does.
Can anyone explain me what I can do to accomplish this?
Steps are:
- I need to pass an optional parameter to npm like:
npm start Initial. - I need to be able to do the same inside the container:.
I have a file.sh that do something like this:
#!/bin/bash
if [ $1 = "Initial" ]; then
: npm start $1
else
: npm start
fi
But again, when I run the docker with something like this :
docker run [image-name] Initial
It doesn't give me any error but is not executing my node.js script. My Dockerfile is something like this:
...
WORKDIR /usr/src/app
RUN npm install
COPY ./ ./
RUN ["chmod", "+x", "/usr/src/app/file.sh"]
ENTRYPOINT ["/usr/src/app/file.sh"]