Skip to content

Commit ab3214b

Browse files
committed
Added: docker support
1 parent fa8c272 commit ab3214b

5 files changed

Lines changed: 54 additions & 15 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.gitignore
3+
README.md
4+
node_modules/
5+
dist/

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node:carbon-alpine
2+
WORKDIR /www
3+
COPY . /www
4+
VOLUME ./:/www
5+
RUN npm install
6+
CMD npm run build && npm start

README.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Site: https://gh-profile-summary.teamsz.xyz
1414
- Chart.js
1515
- Koa
1616
- Github graphql api
17-
- now.sh
1817

1918
## Screenshot
2019

@@ -26,19 +25,7 @@ Site: https://gh-profile-summary.teamsz.xyz
2625

2726
![](https://user-images.githubusercontent.com/12621342/35951773-d1c9cf50-0cb7-11e8-80b2-08ae7d876533.png)
2827

29-
## Local run
30-
31-
> You need to have node environment!
32-
33-
### Install
34-
35-
``` bash
36-
git clone https://github.com/Molunerfinn/node-github-profile-summary.git
37-
cd node-github-profile-summary
38-
npm install # or yarn
39-
```
40-
41-
### Setup
28+
## Setup
4229

4330
First generate a token at https://github.com/settings/tokens
4431

@@ -57,19 +44,55 @@ HTTPS=false
5744
5845
**If you set `HTTPS=true`, then the websocket will connect the 443 port, it's useful for https production.**
5946

47+
## Local run
48+
49+
### Node.js
50+
51+
> You need to have node environment!
52+
53+
### Install
54+
55+
``` bash
56+
git clone https://github.com/Molunerfinn/node-github-profile-summary.git
57+
cd node-github-profile-summary
58+
npm install # or yarn
59+
```
60+
6061
### Run
6162

6263
```bash
6364
npm run build
6465
npm start
6566
```
6667

68+
**Notice:** 8888 is the `KOA_PORT` in `.env` file
69+
70+
And then open the link `http://localhost:8888`, Done.
71+
72+
### Docker
73+
74+
> You need to have docker environment!
75+
76+
### Build
77+
78+
```bash
79+
docker build -t github-profile .
80+
```
81+
82+
### Run
83+
84+
```bash
85+
docker run -it --rm --name github-profile -p 8888:8888 github-profile
86+
```
87+
88+
**Notice:** 8888 is the `KOA_PORT` in `.env` file
89+
6790
And then open the link `http://localhost:8888`, Done.
6891

6992
## TODOS
7093

7194
- More useful charts
72-
- Docker support
95+
- ~~Docker support~~
7396
- ...
7497

7598

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"chalk": "^2.0.1",
5757
"copy-webpack-plugin": "^4.0.1",
5858
"css-loader": "^0.28.0",
59+
"dotenv": "^5.0.1",
5960
"eslint": "^4.15.0",
6061
"eslint-config-standard": "^10.2.1",
6162
"eslint-friendly-formatter": "^3.0.0",

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,6 +2282,10 @@ dotenv@^4.0.0:
22822282
version "4.0.0"
22832283
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"
22842284

2285+
dotenv@^5.0.1:
2286+
version "5.0.1"
2287+
resolved "http://registry.npm.taobao.org/dotenv/download/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
2288+
22852289
duplexer@^0.1.1:
22862290
version "0.1.1"
22872291
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"

0 commit comments

Comments
 (0)