Merge branch 'docker-part-2' into 'dev'
Further docker work, moved from Pm2 to plain cron See merge request martind2000/lot!3
This commit is contained in:
commit
10b4a6d977
@ -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"]
|
||||
|
3
Docker/cronjobs
Normal file
3
Docker/cronjobs
Normal 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
|
@ -1,7 +1,7 @@
|
||||
version: '3.5'
|
||||
|
||||
services:
|
||||
slack:
|
||||
lot:
|
||||
container_name: Lot
|
||||
build:
|
||||
context: .
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user