Nodemon: How to manually restart nodemon in a Docker container?

Created on 17 Oct 2018  ·  3Comments  ·  Source: remy/nodemon

https://github.com/remy/nodemon#manual-restarting

  • nodemon -v: 1.18.4
  • node -v: 10.4.1
  • Operating system/terminal environment: node alpine docker image
  • Command you ran: docker exec -ti hash sh, rs, rsr, rsn, /node_modules/nodemon/bin/node nodemon.js rs

Expected behaviour

Manually trigger a restart as if I change a file.

Actual behaviour

Doesn't happen

Steps to reproduce

Install Docker
Create a Node:Alpine 10 image
Add Nodemon
Build and Start the Container
docker ps
docker exec -ti hash sh
Restart manually, how?


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

stale

Most helpful comment

@danizavtz Thank you I know those. I'd like to know about the manual update as described in the official documentation. I'm connected to a server via shell. I'm forcing nodemon by editing a file but I'd like to know how to do it without having to modify a file as shown here

All 3 comments

Hello, have you tried to use docker-compose?
You can share your current path . with your container running app folder, using a volume.
here is my docker-compose.yml, just for inspiration.

version: '3'

services:
  db:
    image: mysql:5.7
    ports:
      - "3306:3306"
    environment:
      MYSQL_USER: root
      MYSQL_DATABASE: mydbname
      MYSQL_ROOT_PASSWORD: root
      MYSQL_PASSWORD: root

  web:
    build:
      context: .
      dockerfile: Dockerfile
    command: /entrypoint.sh
    volumes:
      - ./webclient/.tmp/serve:/gamma/webclient
    ports:
      - "8000:8000"
    depends_on:
      - db

Another way to force the restart is doing a docker cp and force file changes inside file system of your container.

@danizavtz Thank you I know those. I'd like to know about the manual update as described in the official documentation. I'm connected to a server via shell. I'm forcing nodemon by editing a file but I'd like to know how to do it without having to modify a file as shown here

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ehmicky picture ehmicky  ·  4Comments

medoix picture medoix  ·  4Comments

Bastorx picture Bastorx  ·  5Comments

jagged3dge picture jagged3dge  ·  4Comments

binarykitchen picture binarykitchen  ·  5Comments