Sails.js running on Docker with Phantom.js installed
docker build -t yourname/sails-phantomjs .
docker pull luis/sails-phantomjs
First create a new project:
docker run -it --rm -p 1337:1337 -v /path_to_project_on_host:/var/www -v /var/log/sails:/var/log/supervisor luis/sails-phantomjs sails new
Then install dependencies:
docker run -it --rm -p 1337:1337 -v /path_to_project_on_host:/var/www -v /var/log/sails:/var/logs/supervisor luis/sails-phantomjs npm install
Note: If you get an error, remove the node_modules directory on the host and try again the last command, aparently there's a bug with the latest version of NPM
Run the server:
docker run -d -p 1337:1337 -v /path_to_project_on_host:/var/www -v /var/log/sails:/var/log/supervisor luis/sails-phantomjs
If you need to run any sails command, just do:
docker run --it --rm -v /path_to_project_on_host:/var/www luis/sails-phantomjs sails command
The following node.js modules have been installed globally
Content type
Image
Digest
sha256:9ed0c8ec9…
Size
477.9 MB
Last updated
about 11 years ago
docker pull luis/sails-phantomjs