diff --git a/Dockerfile b/Dockerfile index f89884f..95c9bf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* WORKDIR /data COPY --from=builder /app/target/release/web-petting /usr/local/bin/web-petting -COPY static ./static +COPY static /app/static EXPOSE 3000 CMD ["web-petting"] diff --git a/src/public.rs b/src/public.rs index c224efe..8b33c3d 100644 --- a/src/public.rs +++ b/src/public.rs @@ -400,11 +400,11 @@ async fn serve_static(_request: Request, Path(filename): Path) -> cot::R return Html::new("404").into_response(); } let ext = filename.rsplit('.').next().unwrap_or(""); - // Try relative path first, then /data/static/ (Docker) + // Try relative path first, then /app/static/ (Docker) let path = format!("static/{filename}"); let data = match tokio::fs::read(&path).await { Ok(d) => d, - Err(_) => match tokio::fs::read(format!("/data/static/{filename}")).await { + Err(_) => match tokio::fs::read(format!("/app/static/{filename}")).await { Ok(d) => d, Err(_) => return Html::new("404").into_response(), },