diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 9d62071..7eaf803 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -5,7 +5,9 @@ ENV VERSION ${VERSION:-development} WORKDIR /app -COPY ./Docker/start.sh ./package*.json ./Docker/ecosystem.config.json /app/ +COPY ./package*.json /app/ + +COPY ./Docker/cronjobs /etc/crontabs/root COPY ./app /app/app @@ -13,10 +15,6 @@ COPY ./libs /app/libs COPY ./data /app/data -RUN npm install pm2 -g && npm install +RUN npm install -# RUN ls -lh . - -RUN chmod +x /app/start.sh - -ENTRYPOINT ["/app/start.sh"] +CMD ["crond", "-f", "-d", "8"] diff --git a/Docker/cronjobs b/Docker/cronjobs new file mode 100644 index 0000000..75ccb74 --- /dev/null +++ b/Docker/cronjobs @@ -0,0 +1,3 @@ +0 * * * * echo "$(date '+%Y-%m-%d_%H%M%S')" 2>&1 +10 15 * * 2,5 npm run predict 2>&1 +45 9 * * 3,6 npm run retrieve 2>&1 diff --git a/docker-compose.yml b/docker-compose.yml index 9913b2a..e22ed0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.5' services: - slack: + lot: container_name: Lot build: context: . diff --git a/package.json b/package.json index ad3c98b..a07e462 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node lot.js", - "retrieve": "node app.js" + "retrieve": "node ./app/retriever.js", + "predict" : "node ./app/predict.js" }, "author": "", "license": "ISC",