Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

63 fix docker compose config #64

Merged
merged 4 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
.env
.env.override
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: "3"

networks:
default:
name: pih-rs
services:
backend:
container_name: pih-rs-api
Expand All @@ -9,8 +12,7 @@ services:
dockerfile: Dockerfile
env_file:
- ./.env
environment:
RUST_BACKTRACE: 1
- ./.env.override
ports:
- "3000:3000"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn serve(config: Config, db_pool: PgPool) -> anyhow::Result<()> {

let app = api_router(api_context);

let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 3000));
let addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, 3000));
let listener = TcpListener::bind(addr).await?;
axum::serve(listener, app)
.with_graceful_shutdown(shutdown_signal())
Expand Down
4 changes: 2 additions & 2 deletions src/http/sensors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ async fn create_sensor_reading(

match result {
Ok(_) => {
println!("ROW inserted");
tracing::debug!("Successfully inserted row: {:?}", &result);
}
Err(error) => {
println!("ERROR inserting row: {}", error);
tracing::error!("Error inserting row: {:?}", error);
}
}

Expand Down