diff --git a/web/Cargo.toml b/web/Cargo.toml index 425d7cf..70f6ee8 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "pronouns_today_web" +name = "pronouns-today-web" version = "0.1.0" -edition = "2021" +edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..98b407b --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,10 @@ +FROM rust:1.56-alpine3.13 AS builder +RUN apk update +RUN apk add musl-dev +ADD . . +WORKDIR web +RUN cargo build --target=x86_64-unknown-linux-musl --release + +FROM scratch +COPY --from=builder target/x86_64-unknown-linux-musl/release/pronouns_today_web / +CMD ["/pronouns_today_web"] diff --git a/web/build-docker.sh b/web/build-docker.sh new file mode 100755 index 0000000..61e2900 --- /dev/null +++ b/web/build-docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build .. -t 'pronouns_today_web' -f Dockerfile diff --git a/web/src/main.rs b/web/src/main.rs index a97caee..2dd866d 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -139,6 +139,7 @@ async fn not_found() -> impl Responder { #[actix_web::main] async fn main() -> std::io::Result<()> { env_logger::init(); + println!("Starting pronouns-today-web on 127.0.0.1:8080"); HttpServer::new(|| { let logger = Logger::default(); let app = App::new()