diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fddc52a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +services: + nodejs: + image: node:latest + container_name: nodejs_app + network_mode: host + restart: on-failure + deploy: + restart_policy: + condition: on-failure + max_attempts: 3 + window: 3600s + volumes: + - .:/app + working_dir: /app + command: sh -c "npm install && npm start" \ No newline at end of file diff --git a/package.json b/package.json index d3b61a2..4f1610e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node index.js" }, "author": "", "license": "ISC",