Commit cebf02f 1 parent 81811a0 commit cebf02f Copy full SHA for cebf02f
File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 37
37
ports :
38
38
- name : http
39
39
containerPort : {{ .Values.service.targetPort }}
40
+ hostPort : 80
40
41
protocol : TCP
42
+ env :
43
+ - name : PORT
44
+ value : " 80"
41
45
envFrom :
42
46
- configMapRef :
43
47
name : {{ .Values.config }}
Original file line number Diff line number Diff line change @@ -7,14 +7,19 @@ use redis::aio::ConnectionManager;
7
7
use redis:: Client ;
8
8
use std:: env;
9
9
use std:: time:: Duration ;
10
+ use lazy_static:: lazy_static;
10
11
use tracing:: info;
11
12
use gitdata:: app:: services:: AppState ;
12
13
use gitdata:: router:: router;
13
14
15
+ lazy_static ! {
16
+ pub static ref PORT : u16 = std:: env:: var( "PORT" ) . expect( "PORT must setting" ) . parse( ) . expect( "PORT must be number" ) ;
17
+ }
18
+
14
19
#[ tokio:: main]
15
20
async fn main ( ) -> Result < ( ) , std:: io:: Error > {
16
21
tracing_subscriber:: fmt ( ) . init ( ) ;
17
- let listener = TcpListener :: bind ( "0.0.0.0:80" ) ;
22
+ let listener = TcpListener :: bind ( format ! ( "0.0.0.0:{}" , * PORT ) ) ;
18
23
let state = AppState :: init_env ( ) . await ?;
19
24
let app = router ( )
20
25
. at ( "/" , get ( index) )
You can’t perform that action at this time.
0 commit comments