1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2025-03-14 05:04:40 -05:00

chg: Bind server to port env variable

This commit is contained in:
Solninja A 2025-01-18 12:52:19 +10:00
parent fc785c3eef
commit 1047763285
2 changed files with 3 additions and 3 deletions

View file

@ -78,7 +78,7 @@ async fn main() -> Result<()> {
}
// Tell the user that the server has started, and where it is listening to, rather than simply outputting nothing
eprintln!("Server has started at 0.0.0.0 on port 4567.");
eprintln!("Server has started at 0.0.0.0 on port {port}.");
// Actually start the server
HttpServer::new(move || {
@ -113,7 +113,7 @@ async fn main() -> Result<()> {
.default_service(actix_web::web::get().to(services::error404))
})
// Hardcode the port the server listens to. Allows for more intuitive Docker Compose port management
.bind(("0.0.0.0", 4567))?
.bind(("0.0.0.0", port))?
.run()
.await
}

View file

@ -8,7 +8,7 @@ services:
container_name: chhoto-url
ports:
# If you changed the "port" environment variable, adjust accordingly
# The number before the colon should match the "port" variable
# Both numbers before and after the colon should match the "port" variable
- 4567:4567
environment:
# Change if you want to mount the database somewhere else.