Further docker work, moved from Pm2 to plain cron

This commit is contained in:
Martin Donnelly 2022-05-13 23:14:42 +01:00
parent 557e6d9005
commit 9c6b67939a
4 changed files with 11 additions and 9 deletions

View File

@ -5,7 +5,9 @@ ENV VERSION ${VERSION:-development}
WORKDIR /app 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 COPY ./app /app/app
@ -13,10 +15,6 @@ COPY ./libs /app/libs
COPY ./data /app/data COPY ./data /app/data
RUN npm install pm2 -g && npm install RUN npm install
# RUN ls -lh . CMD ["crond", "-f", "-d", "8"]
RUN chmod +x /app/start.sh
ENTRYPOINT ["/app/start.sh"]

3
Docker/cronjobs Normal file
View File

@ -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

View File

@ -1,7 +1,7 @@
version: '3.5' version: '3.5'
services: services:
slack: lot:
container_name: Lot container_name: Lot
build: build:
context: . context: .

View File

@ -6,7 +6,8 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "node lot.js", "start": "node lot.js",
"retrieve": "node app.js" "retrieve": "node ./app/retriever.js",
"predict" : "node ./app/predict.js"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",