diff --git a/Dockerfile b/Dockerfile index 275be4503..0a61d30b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM keymetrics/pm2:8-alpine ENV NODE_ENV production WORKDIR /usr/src/app COPY ["package.json", "./"] -RUN yarn --prod -s && mv node_modules ../ +RUN yarn --ignore-engines --prod -s && mv node_modules ../ COPY . . EXPOSE 1200 -CMD pm2-runtime start process.json \ No newline at end of file +CMD pm2-runtime start process.json diff --git a/Procfile b/Procfile new file mode 100644 index 000000000..1da0cd6f6 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node index.js diff --git a/app.json b/app.json new file mode 100644 index 000000000..8ad135363 --- /dev/null +++ b/app.json @@ -0,0 +1,39 @@ +{ + "name": "RSSHub", + "description": "Connect the world with RSS", + "repository": "https://github.com/DIYgod/RSSHub", + "website": "https://rsshub.js.org/", + "logo": "https://i.imgur.com/NZpRScX.png", + "keywords": ["RSS"], + "env": { + "PORT": { + "value": "80", + "required": false + }, + "PIXIV_USERNAME": { + "required": false + }, + "PIXIV_PASSWORD": { + "required": false + }, + "DISQUS_API_KEY": { + "required": false + }, + "TWITTER_CONSUMER_KEY": { + "required": false + }, + "TWITTER_CONSUMER_SECRET": { + "required": false + }, + "TWITTER_ACCESS_TOKEN": { + "required": false + }, + "TWITTER_ACCESS_TOKEN_SECRET": { + "required": false + }, + "YOUTUBE_KEY": { + "required": false + } + } +} + diff --git a/config.js b/config.js index 472a546c1..2b528ee7a 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,5 @@ module.exports = { - port: 1200, + port: process.env.PORT || 1200, cacheType: 'memory', // support memory and redis, set empty to disable cache cacheExpire: 5 * 60, ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36', @@ -21,4 +21,4 @@ module.exports = { youtube: { key: process.env.YOUTUBE_KEY } -}; \ No newline at end of file +}; diff --git a/docs/install/README.md b/docs/install/README.md index 2df85913a..3ddf9de8d 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -30,4 +30,8 @@ `twitter`: [申请地址](https://apps.twitter.com) -`youtube`: [申请地址](https://console.developers.google.com/) \ No newline at end of file +`youtube`: [申请地址](https://console.developers.google.com/) + +## 部署到 Heroku +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) + diff --git a/package.json b/package.json index ce5871638..a50b0a347 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,8 @@ "readall": "1.0.0", "twit": "2.2.9", "winston": "3.0.0-rc3" + }, + "engines": { + "node": ">=10.0.0" } }