Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manually restart nodemon in a Docker container? #1438

Closed
Makoehle opened this issue Oct 17, 2018 · 3 comments
Closed

How to manually restart nodemon in a Docker container? #1438

Makoehle opened this issue Oct 17, 2018 · 3 comments
Labels
stale no activity for 2 weeks

Comments

@Makoehle
Copy link

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, rs\r, rs\n, /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.

@danizavtz
Copy link

danizavtz commented Oct 18, 2018

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.

@Makoehle
Copy link
Author

@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

@stale
Copy link

stale bot commented Nov 2, 2018

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

@stale stale bot added the stale no activity for 2 weeks label Nov 2, 2018
@stale stale bot closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity for 2 weeks
Projects
None yet
Development

No branches or pull requests

2 participants