Skip to content

Commit

Permalink
Deploy to Heroku (#117)
Browse files Browse the repository at this point in the history
* Specify Node.js version

* Deploy to Heroku
  • Loading branch information
cdpath authored and DIYgod committed May 14, 2018
1 parent c70873d commit 7efe082
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
CMD pm2-runtime start process.json
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node index.js
39 changes: 39 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}

4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -21,4 +21,4 @@ module.exports = {
youtube: {
key: process.env.YOUTUBE_KEY
}
};
};
6 changes: 5 additions & 1 deletion docs/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@

`twitter`: [申请地址](https://apps.twitter.com)

`youtube`: [申请地址](https://console.developers.google.com/)
`youtube`: [申请地址](https://console.developers.google.com/)

## 部署到 Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
"readall": "1.0.0",
"twit": "2.2.9",
"winston": "3.0.0-rc3"
},
"engines": {
"node": ">=10.0.0"
}
}

0 comments on commit 7efe082

Please sign in to comment.