diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..171e8a3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +.gitignore +README.md +node_modules/ +dist/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ae5e241 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:carbon-alpine +WORKDIR /www +COPY . /www +VOLUME ./:/www +RUN npm install +CMD npm run build && npm start diff --git a/README.md b/README.md index 9f8ab26..baee163 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ Site: https://gh-profile-summary.teamsz.xyz - Chart.js - Koa - Github graphql api -- now.sh ## Screenshot @@ -26,19 +25,7 @@ Site: https://gh-profile-summary.teamsz.xyz ![](https://user-images.githubusercontent.com/12621342/35951773-d1c9cf50-0cb7-11e8-80b2-08ae7d876533.png) -## Local run - -> You need to have node environment! - -### Install - -``` bash -git clone https://github.com/Molunerfinn/node-github-profile-summary.git -cd node-github-profile-summary -npm install # or yarn -``` - -### Setup +## Setup First generate a token at https://github.com/settings/tokens @@ -57,6 +44,20 @@ HTTPS=false **If you set `HTTPS=true`, then the websocket will connect the 443 port, it's useful for https production.** +## Local run + +### Node.js + +> You need to have node environment! + +### Install + +``` bash +git clone https://github.com/Molunerfinn/node-github-profile-summary.git +cd node-github-profile-summary +npm install # or yarn +``` + ### Run ```bash @@ -64,12 +65,34 @@ npm run build npm start ``` +**Notice:** 8888 is the `KOA_PORT` in `.env` file + +And then open the link `http://localhost:8888`, Done. + +### Docker + +> You need to have docker environment! + +### Build + +```bash +docker build -t github-profile . +``` + +### Run + +```bash +docker run -it --rm --name github-profile -p 8888:8888 github-profile +``` + +**Notice:** 8888 is the `KOA_PORT` in `.env` file + And then open the link `http://localhost:8888`, Done. ## TODOS - More useful charts -- Docker support +- ~~Docker support~~ - ... diff --git a/build/logo.png b/build/logo.png index f3d2503..fdf2fb2 100644 Binary files a/build/logo.png and b/build/logo.png differ diff --git a/now.json b/now.json index 4a67628..9e9da67 100644 --- a/now.json +++ b/now.json @@ -1,4 +1,5 @@ { + "version": 1, "env": { "GH_TOKEN": "@gh-summary-token", "JWT_SECRET": "@jwt-secret" diff --git a/package.json b/package.json index e4d5751..091f555 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "chalk": "^2.0.1", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", + "dotenv": "^5.0.1", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", diff --git a/src/assets/logo.png b/src/assets/logo.png index 3631237..22a64ae 100644 Binary files a/src/assets/logo.png and b/src/assets/logo.png differ diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 68a90f1..881fa24 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -333,7 +333,7 @@ export default { width calc(100% - 56px) word-wrap: break-word line-height: 20px - padding-left 4px + padding-right 4px &.small-text font-size 16px &-status diff --git a/yarn.lock b/yarn.lock index 5cfd362..a0d3dd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2282,6 +2282,10 @@ dotenv@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d" +dotenv@^5.0.1: + version "5.0.1" + resolved "http://registry.npm.taobao.org/dotenv/download/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"