Parcourir la source

Utilize standard configuration for port mapping

Mark Rousskov il y a 5 ans
Parent
commit
141aa9a26d
2 fichiers modifiés avec 2 ajouts et 8 suppressions
  1. 1 1
      Dockerfile
  2. 1 7
      src/main.rs

+ 1 - 1
Dockerfile

@@ -52,5 +52,5 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
     ca-certificates
 
 COPY --from=build /tmp/source/target/release/triagebot /usr/local/bin/
-ENV TRIAGEBOT_PORT=80
+ENV ROCKET_PORT=80
 CMD triagebot

+ 1 - 7
src/main.rs

@@ -106,13 +106,7 @@ fn main() {
         username: github::User::current(&gh).unwrap().login,
     };
 
-    let mut config = rocket::Config::active().unwrap();
-    config.set_port(
-        env::var("TRIAGEBOT_PORT")
-            .map(|port| port.parse().unwrap())
-            .unwrap_or(8000),
-    );
-    rocket::custom(config)
+    rocket::ignite()
         .manage(gh)
         .manage(ctx)
         .mount("/", routes![webhook])