ezidam: dont put relative path for static files, bundle them in docker image

This commit is contained in:
Philippe Loctaux 2023-03-20 23:16:43 +01:00
parent 7aa5c96f7a
commit 8365bc5dff
2 changed files with 2 additions and 1 deletions

View file

@ -20,6 +20,7 @@ RUN cargo build --release --target x86_64-unknown-linux-musl --package ezidam --
FROM scratch
COPY --from=builder /ezidam/target/x86_64-unknown-linux-musl/release/ezidam /ezidam
COPY crates/ezidam/static static
ENV ROCKET_CLI_COLORS=0
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000

View file

@ -37,7 +37,7 @@ pub fn rocket_setup(rocket_builder: Rocket<Build>) -> Rocket<Build> {
let rocket_builder = rocket_builder.attach(Template::fairing());
// Static assets
let rocket_builder = rocket_builder.mount("/", FileServer::from(relative!("static")));
let rocket_builder = rocket_builder.mount("/", FileServer::from("static"));
// Routes
let rocket_builder = routes::routes(rocket_builder);