- fix: docker libssl in slim image

- fix: api service default rest api address and port was incorrect
- update: database service to use dedicated function for running the health check api
This commit is contained in:
2024-12-14 05:54:32 -05:00
parent c17d498b93
commit 7194eb88fa
6 changed files with 7 additions and 12 deletions

View File

@@ -62,8 +62,8 @@ pub async fn serve_rest_api(
.with_state(grpc_client) .with_state(grpc_client)
.layer(cors); .layer(cors);
let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "127.0.0.1".to_string()); let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0".to_string());
let port = env::var("API_SERVICE_PORT").unwrap_or_else(|_| "50050".to_string()); let port = env::var("API_SERVICE_PORT").unwrap_or_else(|_| "8080".to_string());
let listener = tokio::net::TcpListener::bind(format!("{}:{}", addr, port)) let listener = tokio::net::TcpListener::bind(format!("{}:{}", addr, port))
.await .await
.unwrap(); .unwrap();

View File

@@ -1,4 +1,4 @@
FROM rust:1.83 as builder FROM rust:1.83 AS builder
LABEL authors="raven" LABEL authors="raven"
WORKDIR /usr/src/proto WORKDIR /usr/src/proto

View File

@@ -1,4 +1,4 @@
FROM rust:1.83 as builder FROM rust:1.83 AS builder
LABEL authors="raven" LABEL authors="raven"
WORKDIR /usr/src/proto WORKDIR /usr/src/proto

View File

@@ -53,12 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
) )
.await?; .await?;
// Start health-check endpoint consul_registration::start_health_check(addr.as_str()).await?;
let health_route = warp::path!("health")
.map(|| warp::reply::with_status("OK", warp::http::StatusCode::OK));
tokio::spawn(warp::serve(health_route).run(health_check_endpoint_addr.to_socket_addrs()?.next().unwrap()));
let full_addr = format!("{}:{}", &addr, port); let full_addr = format!("{}:{}", &addr, port);
let address = full_addr.parse().expect("Invalid address"); let address = full_addr.parse().expect("Invalid address");

View File

@@ -1,4 +1,4 @@
FROM rust:1.83 as builder FROM rust:1.83 AS builder
LABEL authors="raven" LABEL authors="raven"
WORKDIR /usr/src/proto WORKDIR /usr/src/proto

View File

@@ -1,4 +1,4 @@
FROM rust:1.83 as builder FROM rust:1.83 AS builder
LABEL authors="raven" LABEL authors="raven"
WORKDIR /usr/src/proto WORKDIR /usr/src/proto