From a767d70354811dedba489e9b10a8fc077f2d083b Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 8 Dec 2024 13:29:58 +0100 Subject: [PATCH] Create uploads if does not exists --- dockerfile | 2 -- src/app.rs | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index 1bfb017..272b05a 100644 --- a/dockerfile +++ b/dockerfile @@ -15,6 +15,4 @@ COPY --from=builder /usr/src/assets/static/404.html /usr/app/assets/static/404.h COPY --from=builder /usr/src/config /usr/app/config COPY --from=builder /usr/src/target/release/gabrielkaszewski_rs-cli /usr/app/gabrielkaszewski_rs-cli -RUN mkdir -p /usr/app/uploads - ENTRYPOINT ["/usr/app/gabrielkaszewski_rs-cli", "start"] \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index b629bd5..06c80ed 100644 --- a/src/app.rs +++ b/src/app.rs @@ -60,6 +60,10 @@ impl Hooks for App { } async fn after_context(ctx: AppContext) -> Result { + // Create uploads directory if it doesn't exist + let _ = std::fs::create_dir("uploads"); + + let store = storage::drivers::local::new_with_prefix("uploads").map_err(Box::from)?; Ok(AppContext {