Sign inSign up

scotthz/cncjs

By scotthz

Updated about 8 years ago

CNCjs for Raspberry Pi

Image
2

1.2K

scotthz/cncjs repository overview

Using this image is easier than installing CNCjs on bare-metal Raspberry Pi.

I run CNCjs as a service using systemd so that CNCjs starts automatically on boot. See below for the simple service file.

The following command line can be used to launch the container when not running as a service. I map port 80 to the container because I have a dedicated Raspberry Pi for CNCjs and don't run anything else on it. I map a folder to /cncjs in the container, though that doesn't do much in normal usage, but in can be useful if you run a shell CLI in the container.

docker run --privileged --rm --detach --volume /home/pi/Desktop:/cncjs --publish 80:8000 scotthz/cncjs:latest

Dockerfile
FROM resin/raspberrypi3-node:latest
MAINTAINER https://hub.docker.com/u/scotthz/
RUN npm install -g cncjs@latest --unsafe-perm
CMD ["/usr/local/bin/cncjs"]
cncjs.service
  1. Put the following in a new file named /etc/systemd/system/cncjs.service.
Description=CNC.js service
After=docker.service

[Service]
ExecStart=/usr/bin/docker run --privileged --rm --detach --volume /home/pi/Desktop/cncjs:/cncjs --publish 80:8000 cncjs:latest

[Install]
WantedBy=multi-user.target
Alias=cncjs.service
  1. Enable it to start on boot using this command once (as root):

systemctl enable cncjs

  1. Start it manually using this command (as root):

systemctl start cncjs

Tag summary

Content type

Image

Digest

Size

230.8 MB

Last updated

about 8 years ago

docker pull scotthz/cncjs