add dockerfile to serve content on port 3000

add a println! statement to check that the service starts serving
This commit is contained in:
m0veax 2024-05-24 00:18:27 +02:00
parent f1b78f9d57
commit 4b85aa9927
3 changed files with 12 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
/target

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM rust:1.75.0
WORKDIR /usr/src/chaospott-status
COPY . .
RUN cargo install --path .
EXPOSE 3000
CMD ["chaospott-status"]

View File

@ -21,6 +21,8 @@ async fn main() {
.route("/api/update.php", post(the_doors)); .route("/api/update.php", post(the_doors));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
println!("Start serving");
axum::serve(listener, app).await.unwrap(); axum::serve(listener, app).await.unwrap();
} }