Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Node.js Container

Featured Replies

What I am trying to do is run a simple node.js app in a container, instead of the Ubuntu VM it is in now. I am a docker novice, but have been using it for a few years - mostly pre-made containers, but on Ubuntu I've made a few of my own that work as expected. I've never used a custom container in unraid, though, and the differences are tripping me up.

 

In the end, what I'm trying to do is exactly what is described on the official node.js docker page:

Quote

 

Run a single Node.js script

 

For many simple, single file projects, you may find it inconvenient to write a complete Dockerfile. In such cases, you can run a Node.js script by using the Node.js Docker image directly:

$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:8 node your-daemon-or-script.js

 

Is there a relatively straight forward way to do this in Unraid? I see how I can import the node container from docker hub, but past that I'm struggling.

 

Thanks in advance for any help or advice.

Edited by JasonJoel

37 minutes ago, JasonJoel said:

and the differences are tripping me up.

Just an FYI, but there are zero differences.  A container is a container is a container.  Thats the whole point of them.  Self-contained applications that can be run on any platform without modifications

  • Author

Fair enough - poor wording choice on my part. How to do the container definition via the GUI was tripping me up.

 

I did get it to work, though, so thought I would come back and at least list how I did it (even though it was simple for anyone that understands docker better than I do :) ):

 

1. Imported node container from docker hub via CA

2. Set network to the interface I needed (br3 in my case)

3. Set static IP address

4. Added a path setting for the /user/src/app container location to /mnt/usr/appdata/<container name>

5. Switched to Advanced View

6. Added "-w /usr/src/app" in "Extra Parameters:"

7. Added "server.js" in "Post Arguments:", with server.js being the name of my node.js app.

8. Hit Apply and ran the container.

 

Probably your best bet is to get it working first via the command line, and then back ported it to the GUI template

  • 2 months later...
On 6/22/2019 at 9:45 AM, JasonJoel said:

6. Added "-w /usr/src/app" in "Extra Parameters:"

7. Added "server.js" in "Post Arguments:", with server.js being the name of my node.js app.

 

 

Thank you for posting these steps. I had the worst time figuring this out for whatever reason.  How did you figure out the extra parameter and post argument steps?

  • 3 years later...

Is there in meantime a solution?

I mean a docker app for node.js for hosting a js app?

  • 2 years later...
On 9/17/2022 at 1:37 PM, Abigel said:

Is there in meantime a solution?

I mean a docker app for node.js for hosting a js app?

Bumping that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.