From 4b85aa9927fb39c4d3911588c5185ec083c7f06a Mon Sep 17 00:00:00 2001 From: m0veax Date: Fri, 24 May 2024 00:18:27 +0200 Subject: [PATCH] add dockerfile to serve content on port 3000 add a println! statement to check that the service starts serving --- .dockerignore | 1 + Dockerfile | 9 +++++++++ src/main.rs | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/target diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6614f10 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM rust:1.75.0 + +WORKDIR /usr/src/chaospott-status +COPY . . +RUN cargo install --path . + +EXPOSE 3000 + +CMD ["chaospott-status"] \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 40cb67d..4fbd6f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,8 @@ async fn main() { .route("/api/update.php", post(the_doors)); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); + + println!("Start serving"); axum::serve(listener, app).await.unwrap(); }