Skip to content

Commit cebf02f

Browse files
committed
feat: Update listener IP address to 0.0.0.0:80
1 parent 81811a0 commit cebf02f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

charts/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ spec:
3737
ports:
3838
- name: http
3939
containerPort: {{ .Values.service.targetPort }}
40+
hostPort: 80
4041
protocol: TCP
42+
env:
43+
- name: PORT
44+
value: "80"
4145
envFrom:
4246
- configMapRef:
4347
name: {{ .Values.config }}

main.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ use redis::aio::ConnectionManager;
77
use redis::Client;
88
use std::env;
99
use std::time::Duration;
10+
use lazy_static::lazy_static;
1011
use tracing::info;
1112
use gitdata::app::services::AppState;
1213
use gitdata::router::router;
1314

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+
1419
#[tokio::main]
1520
async fn main() -> Result<(), std::io::Error> {
1621
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));
1823
let state = AppState::init_env().await?;
1924
let app = router()
2025
.at("/", get(index))

0 commit comments

Comments
 (0)