diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..28be727 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# latest rust will be used to build the binary +FROM rust:latest as builder + +# the temporary directory where we build +WORKDIR /usr/src/microbin + +# copy sources to /usr/src/microbin on the temporary container +COPY . . + +# run release build +RUN cargo build --release + +# create final container using slim version of debian +FROM debian:buster-slim + +# microbin will be in /usr/local/bin/microbin/ +WORKDIR /usr/local/bin + +# copy built exacutable +COPY --from=builder /usr/src/microbin/target/release/microbin /usr/local/bin/microbin + +# copy /static folder containing the stylesheets +COPY --from=builder /usr/src/microbin/static /usr/local/bin/static + +# run the binary +CMD ["microbin"] \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 07139af..b804b2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -376,7 +376,7 @@ async fn main() -> std::io::Result<()> { HttpAuthentication::basic(auth_validator), )) }) - .bind(format!("127.0.0.1:{}", args.port.to_string()))? + .bind(format!("0.0.0.0:{}", args.port.to_string()))? .workers(args.threads as usize) .run() .await