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

Consider Using Docker Compose for Testing/Development #42

Open
adamgoose opened this issue Oct 11, 2019 · 1 comment · May be fixed by #44
Open

Consider Using Docker Compose for Testing/Development #42

adamgoose opened this issue Oct 11, 2019 · 1 comment · May be fixed by #44

Comments

@adamgoose
Copy link
Contributor

adamgoose commented Oct 11, 2019

This is only an idea, so feel free to close this issue right away. After reading your testing.md file, I realized that you're doing the same thing I am with docker-compose. The added benefit of using docker-compose is that the docker commands can be easily shared via a docker-compose.yml file, and you can easily mount your local dev copy into the container. This allows you to both test and develop the nodes at the same time from your host.

version: '3'
services:
  nodered:
    image: nodered/node-red-docker:0.19.5-v8
    ports:
    - 1880:1880
    volumes:
    - .:/local # Your local working copy
    - ./data:/data # Persist configuration between sessions

The following commands accompany this setup:

  • docker-compose up -d - Bring up the dev environment
  • docker-compose exec nodered sh -c "cd /data && npm i /local" - Install your local working copy as nodes
  • docker-compose restart - Restart NodeRED (after npm i and any source code changes)
  • docker-compose exec nodered bash - Get a shell into the container

/data should probably be added to .gitignore, since its just your local NodeRED installation.

Edit: Corrected "install local copy" command.

@sammachin
Copy link
Contributor

interesting, I need to think about this a little more so parking for now but I'll come back to it when I have some more brain capacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants