Compare commits

...

5 Commits

Author SHA1 Message Date
Martin Donnelly
10b4a6d977 Merge branch 'docker-part-2' into 'dev'
Further docker work, moved from Pm2 to plain cron

See merge request martind2000/lot!3
2022-05-13 22:15:47 +00:00
Martin Donnelly
9c6b67939a Further docker work, moved from Pm2 to plain cron 2022-05-13 23:14:42 +01:00
Martin Donnelly
0b95c3951d Merge branch 'docker-part-2' into 'dev'
Updated docker handling, now with docker-compose file

See merge request martind2000/lot!2
2022-05-13 18:33:07 +00:00
Martin Donnelly
557e6d9005 Updated docker handling, now with docker-compose file 2022-05-13 19:31:24 +01:00
Martin Donnelly
c4e1591374 Merge branch 'dockerfy' into 'dev'
Modified the app to run inside a docker container

See merge request martind2000/lot!1
2022-05-12 15:36:24 +00:00
11 changed files with 3100 additions and 81 deletions

20
Docker/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# FROM node:current-slim
FROM node:current-alpine
ARG VERSION
ENV VERSION ${VERSION:-development}
WORKDIR /app
COPY ./package*.json /app/
COPY ./Docker/cronjobs /etc/crontabs/root
COPY ./app /app/app
COPY ./libs /app/libs
COPY ./data /app/data
RUN npm install
CMD ["crond", "-f", "-d", "8"]

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,21 +0,0 @@
FROM node:current-slim
ARG VERSION
ENV VERSION ${VERSION:-development}
WORKDIR /app
COPY start.sh package*.json ecosystem.config.json /app/
COPY ./app/ /app/app
COPY ./libs/ /app/libs
COPY ./data/ /app/data
RUN npm install pm2 -g && npm install
# RUN ls -lh .
RUN chmod +x /app/start.sh
ENTRYPOINT ["/app/start.sh"]

View File

@ -9,7 +9,7 @@ NO_CACHE = true
#build docker image
build:
docker build . -t $(APP_IMAGE) --build-arg VERSION=$(VERSION) --no-cache=$(NO_CACHE) --compress
docker build ./Docker/. -t $(APP_IMAGE) --build-arg VERSION=$(VERSION) --no-cache=$(NO_CACHE) --compress
.PHONY: build
#push docker image to registry

File diff suppressed because one or more lines are too long

1
data_store/data.json Normal file

File diff suppressed because one or more lines are too long

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3.5'
services:
lot:
container_name: Lot
build:
context: .
dockerfile: ./Docker/Dockerfile
image: silvrtree-lot
volumes:
- ./data_store:/app/data

3116
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",
@ -25,7 +26,7 @@
"cheerio": "^1.0.0-rc.2",
"fecha": "^4.2.3",
"log4js": "^6.4.6",
"node-fetch": "^3.2.4",
"node-fetch": "^2.3.0",
"node-pushover": "^1.0.0",
"sugar": "^2.0.1",
"sugar-date": "^2.0.0"