From 1d17c8b637ff278b1e6b0108c6f45dffbb9a10ab Mon Sep 17 00:00:00 2001 From: Aleksei Voronov Date: Fri, 6 Oct 2023 20:24:58 +0200 Subject: [PATCH] Make it able to run in production - Remove the build Dockerfile, it's not useful on cheap VMs because you can't really build anything on them - Update the serving address to be 0.0.0.0 so that it's actually exposed externally (127.0.0.1 isn't) - Also update the port to be 3030 for no reason at all - Add a Cross.toml config file for cross-compilation since my machine isn't exactly Linux that the resulting binary needs to run on --- Cross.toml | 5 +++++ Dockerfile | 18 ------------------ src/processes/feed_server/server.rs | 2 +- 3 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 Cross.toml delete mode 100644 Dockerfile diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..acbc7ef --- /dev/null +++ b/Cross.toml @@ -0,0 +1,5 @@ +[build] +default-target = "x86_64-unknown-linux-gnu" + +[target.x86_64-unknown-linux-gnu] +pre-build = ["apt-get install --assume-yes libssl-dev"] diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fd7d02d..0000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM rust:1.72 - -RUN USER=root cargo new --bin nederlandskie -WORKDIR /nederlandskie - -COPY ./Cargo.lock ./Cargo.lock -COPY ./Cargo.toml ./Cargo.toml - -RUN cargo build --release -RUN rm src/*.rs - -COPY ./src ./src - -RUN rm ./target/release/deps/nederlandskie* -RUN cargo build --release - -EXPOSE 3000 -CMD ["./target/release/nederlandskie"] diff --git a/src/processes/feed_server/server.rs b/src/processes/feed_server/server.rs index d53c34c..aa850e3 100644 --- a/src/processes/feed_server/server.rs +++ b/src/processes/feed_server/server.rs @@ -46,7 +46,7 @@ impl FeedServer { algos: self.algos, }); - let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); + let addr = SocketAddr::from(([0, 0, 0, 0], 3030)); info!("Serving feed on {}", addr);