diff options
| author | Martin Hafskjold Thoresen <martin@vind.ai> | 2025-01-11 15:23:11 +0100 |
|---|---|---|
| committer | Martin Hafskjold Thoresen <martin@vind.ai> | 2025-01-11 15:23:11 +0100 |
| commit | ec697c401e2d2c6c59c7aab7755ccf6620861ca8 (patch) | |
| tree | a52dc5aab7e06941928a0eed18cd8d945620c525 /Dockerfile | |
| parent | 42fd8cd3560047c88a2167a4d5c5845dd81eb3ec (diff) | |
| download | musicgame-master.tar.gz musicgame-master.zip | |
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..132af07 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM messense/rust-musl-cross:aarch64-musl AS base +RUN cargo install cargo-chef --locked + +####################### +FROM base AS planner +WORKDIR /app +##### +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock +COPY ./src ./src +##### +RUN cargo chef prepare --recipe-path recipe.json + +####################### +FROM base AS builder +COPY --from=planner /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path recipe.json +##### +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock +COPY ./src ./src +COPY ./static ./static +##### +RUN cargo build --release + +####################### +FROM --platform=linux/aarch64 alpine:3.20 + +RUN apk add --no-cache curl ca-certificates +COPY --from=builder /home/rust/src/target/aarch64-unknown-linux-musl/release/musicgame /app/server +COPY ./static /app/static + +ENV PATH="${PATH}:/app" +ENV STATIC_DIR="/app/static/" +ENV STAGE="prod" + +WORKDIR "/app" + +EXPOSE 4800 |
