diff --git a/Dockerfile b/Dockerfile index c80db0e..c9b12b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 6b11ba4..20c6fce 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..801ed26 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,4 @@ +version '3' +services: + changedetection: + image: 'mail.caliban.io:5000/changedetection' diff --git a/ecosystem.config.json b/ecosystem.config.json new file mode 100644 index 0000000..7593adc --- /dev/null +++ b/ecosystem.config.json @@ -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 +} diff --git a/start.sh b/start.sh index 30156f0..ac8dd10 100644 --- a/start.sh +++ b/start.sh @@ -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