노드 / 도커 / docker-compose /composer / compose
nodejs application with Docker
crontab 으로 주기적으로 node application 을 run 하게 하려한다.
$ sudo docker build -t my-nodejs-app .
...
$ sudo docker run -t my-node-app2
Best pratices for docker-node
docker-compose
Dockerfile
FROM node:14
ENV USERHOME=/home/node
RUN apt-get update && apt-get install -y cron mysql-client
# install node app
COPY --chown=node:node index.js /home/node/
COPY --chown=node:node package.json /home/node/
# cron tab
COPY dbzipper-crontab /etc/cron.d/dbzipper-crontab
RUN chmod +x /etc/cron.d/dbzipper-crontab
RUN crontab /etc/cron.d/dbzipper-crontab
CMD ["cron", "-f"]
댓글 없음:
댓글 쓰기