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
This commit is contained in:
parent
dec35a867c
commit
1d17c8b637
|
@ -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"]
|
18
Dockerfile
18
Dockerfile
|
@ -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"]
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue