This commit is contained in:
Martin Donnelly 2019-10-23 16:49:03 +01:00
parent 36fc54a52e
commit 61cd414da1
5 changed files with 22 additions and 5 deletions

View File

@ -11,7 +11,7 @@ RUN echo udev hold | dpkg --set-selections;\
WORKDIR /app
COPY start.sh package.json *.js settings.json /app/
COPY start.sh package.json *.js settings.json ecosystem.config.json /app/
COPY lib/ /app/lib
COPY scrapers/ /app/scrapers
COPY pug/ /app/pug

View File

@ -1,9 +1,12 @@
PROJECT = changedetection
VERSION = $(shell git rev-parse --short HEAD)
APP_IMAGE = $(PROJECT):$(VERSION)
ECR_REPO = mail.caliban.io:5000
#APP_IMAGE = 482681734622.dkr.ecr.eu-west-1.amazonaws.com/$(PROJECT):$(VERSION)
APP_IMAGE = $(ECR_REPO)/$(PROJECT):$(VERSION)
NO_CACHE = false
#build docker image
build:
# docker build . -t $(APP_IMAGE) --build-arg VERSION=$(VERSION) --no-cache=$(NO_CACHE)

4
docker-compose.yml Normal file
View File

@ -0,0 +1,4 @@
version '3'
services:
changedetection:
image: 'mail.caliban.io:5000/changedetection'

12
ecosystem.config.json Normal file
View File

@ -0,0 +1,12 @@
{
"name" : "changedetection",
"script" : "changedetection.js",
"env": {
"NODE_ENV": "production",
"PROXY_URI" : "uk.proxymesh.com:31280"
},
"autorestart" : true,
"max_restarts": 3,
"restart_delay": 4000
}

View File

@ -1,8 +1,6 @@
#!/bin/sh
set -ex
eval "$(aws ssm get-parameters-by-path --region $REGION --path "/$SERVICE_NAME/$ENV/" --query 'Parameters[*].{Name:Name,Value:Value}' --output text | sed 's/\/'"$SERVICE_NAME"'\/'"$ENV"'\///g' | awk -F '\t' '{ print "export " $1 "=" "\""$2"\";" }')"
npm show puppeteer version
pm2-runtime start ecosystem.config.js --raw --env production
pm2-runtime start ecosystem.config.json --raw --env production