Compare commits

...

5 Commits

Author SHA1 Message Date
Emi Simpson ba154abd16
Merge branch 'main' into ogp 2021-10-25 21:03:06 -04:00
Emi Simpson 8d8a92a0b5
Added Docker support 2021-10-25 21:02:33 -04:00
Ben Aaron Goldberg 6378adba7a web: Added startup message
Signed-off-by: Ben Aaron Goldberg <ben@benaaron.dev>
2021-10-25 06:41:23 -04:00
Ben Aaron Goldberg 45c6eb39bb web: Revert back to Rust 2018
It has better compatibly and the code works as is.

Signed-off-by: Ben Aaron Goldberg <ben@benaaron.dev>
2021-10-25 06:25:26 -04:00
Ben Aaron Goldberg af85dc7dcf web: rename crate to up dashes instead of underscores.
Signed-off-by: Ben Aaron Goldberg <ben@benaaron.dev>
2021-10-25 06:24:57 -04:00
4 changed files with 15 additions and 2 deletions

View File

@ -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

10
web/Dockerfile Normal file
View File

@ -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"]

2
web/build-docker.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker build .. -t 'pronouns_today_web' -f Dockerfile

View File

@ -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()