From 25eaf2c26bcbfffd21cdd7259921c044e5ca30dc Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Thu, 21 Mar 2024 17:13:55 -0500 Subject: [PATCH] perf: use target=native in docker build (#14) --- Dockerfile | 4 ++-- README.md | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c621a9a..1d367735 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,10 +31,10 @@ COPY server/Cargo.toml ./server/Cargo.toml COPY server/src ./server/src -# Build the source code using Rust Nightly +# Build the source code using Rust Nightly with RUN --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/app/target \ - cargo build --release --locked -p server + RUSTFLAGS='-C target-cpu=native' cargo build --release --locked -p server # Copy the built executable from the cache to a clean directory RUN --mount=type=cache,target=/app/target \ diff --git a/README.md b/README.md index 81efdaa1..efaa6da1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,16 @@ How can we get 10k players to PvP at once on a Minecraft server to break the Guinness World Record? ![image](https://github.com/andrewgazelka/mc-server/assets/7644264/5cb83738-3e85-47e9-b73c-40e75257c5a3) + + +# Running + +```bash +docker compose up +``` + +# Internals + ![image](https://github.com/andrewgazelka/mc-server/assets/7644264/8fb3cd33-4dd7-42fc-a3e0-17e167c64509) ![image](https://github.com/andrewgazelka/mc-server/assets/7644264/5272317f-48c3-4e15-a032-73d9229a4413)