diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e910b0e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/target +/static +/.git \ No newline at end of file diff --git a/Caddyfile b/Caddyfile index 3ab709d..3d81aea 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,4 +1,10 @@ *:80 { + route /favicon.ico { + file_server { + root ./static + } + } + route /static/* { uri strip_prefix /static file_server { diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f3952db --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM rust:1.67-slim as build + +COPY ./ ./ + +RUN cargo build --release + +FROM debian:stable-slim + +COPY --from=build ./target/release/personal-site . + +CMD ["./personal-site"] \ No newline at end of file