allow PORT env var, cargo update
This commit is contained in:
parent
6b9c879ba7
commit
d22a0762ab
3 changed files with 334 additions and 373 deletions
670
Cargo.lock
generated
670
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,27 +0,0 @@
|
||||||
job "agg-population" {
|
|
||||||
type = "service"
|
|
||||||
|
|
||||||
update {
|
|
||||||
max_parallel = 1
|
|
||||||
stagger = "10s"
|
|
||||||
}
|
|
||||||
|
|
||||||
group "api" {
|
|
||||||
count = 1
|
|
||||||
|
|
||||||
network {
|
|
||||||
port "http" {
|
|
||||||
static = 3000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task "api" {
|
|
||||||
driver = "docker"
|
|
||||||
|
|
||||||
config {
|
|
||||||
image = "ghcr.io/genudine/agg-population/agg-population:latest"
|
|
||||||
ports = ["http"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
10
src/main.rs
10
src/main.rs
|
@ -49,8 +49,14 @@ async fn main() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
|
let addr = SocketAddr::from((
|
||||||
tracing::debug!("listening on {}", addr);
|
[0, 0, 0, 0],
|
||||||
|
std::env::var("PORT")
|
||||||
|
.unwrap_or("3000".to_string())
|
||||||
|
.parse()
|
||||||
|
.unwrap(),
|
||||||
|
));
|
||||||
|
tracing::debug!("listening on http://{}", addr);
|
||||||
axum::Server::bind(&addr)
|
axum::Server::bind(&addr)
|
||||||
.serve(app.into_make_service())
|
.serve(app.into_make_service())
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Add table
Reference in a new issue