diff --git a/Cargo.toml b/Cargo.toml index d250f87..d8754a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "Website" +name = "website" version = "0.1.0" edition = "2024" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88be1be --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Build stage +FROM rust:alpine AS builder +ARG build="cargo build --release" +COPY Cargo.toml /app/Cargo.toml +COPY src /app/src +WORKDIR "/app" +RUN $build + +# Runtime stage +FROM alpine:latest +ARG binary="/app/target/release/website" +ARG target="/usr/local/bin/website" +COPY --from=builder $binary $target +COPY frontend /data/frontend +ENV ROCKET_ADDRESS="0.0.0.0" +WORKDIR "/data" +CMD ["website"]