diff --git a/.dockerignore b/.dockerignore index 1c45c39..924d6f8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,9 +3,6 @@ .git .gitignore Dockerfile -Makefile README.md -flake.lock -flake.nix target tests diff --git a/Dockerfile b/Dockerfile index 69f2d7d..49eaca7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,15 @@ -FROM rust AS builder +# TODO support pure Nix container build instead of Dockerfile +# I'm to lazy to make static binary to work with both Nix & Dockerfile at the same time +FROM nixos/nix -WORKDIR /app +RUN echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf \ + && echo 'filter-syscalls = false' >> /etc/nix/nix.conf -RUN apt-get update && apt-get install -y pkg-config openssl libssl-dev -RUN rustup target add wasm32-unknown-unknown -RUN cargo install --locked cargo-leptos +WORKDIR /app COPY . . -RUN cargo leptos build --release - -FROM debian:12-slim - -COPY --from=builder /app/target/release/blog /app/target/release/blog -COPY --from=builder /app/target/site /app/target/site - -WORKDIR /app +RUN nix develop --command make EXPOSE 3000 -CMD ["./target/release/blog"] +CMD ["/app/target/release/blog"]