simple realtime HTML5 canvas page
These instructions will get you a copy of the project and running on your local machine for development and production mode using docker.
- Node.js 6^
- Npm 3^
- babel-cli 6^
- install global dependencies
npm install -g babel-cli
- babel-cli transpile ES6 codes and import syntax.
- Clone the project from the github repository
git clone [email protected]:TK-one/realtime-canvas.git
cd realtime-canvas
- install node dependencies
npm install
- run server on port 3000 and open public/index.html file with your browser.
npm start
- run test
npm test
- run server on port 3000
npm start
- install pm2 globally
npm install -g pm2
- change your address for socket server in public/index.html
'http://localhost:3000' => [your host domain or ip]
- run app with pm2
cd realtime-canvas
pm2 start pm2.json
- pull nginx image
docker pull nginx:latest
- change your address for socket server in public/index.html
'http://localhost:3000' => [your host domain or ip]
- run nginx container
docker run -i -t --name [container-name] -v [path_to_directory]/public:/usr/share/nginx/html:ro -d -p 80:80 -p 443:443 nginx
- build app Docker image
docker build --tag realtime-canvas:0.1 .
- run app container on port 3000
docker run -i -t -d --name realtime-canvas -p 3000:3000 realtime-canvas:0.1
- check docker container status
docker ps -a
test