From 8d3190c343728de15d07f098d49e9f2929eedb0e Mon Sep 17 00:00:00 2001 From: Alex Wright Date: Wed, 1 Apr 2026 22:42:46 +0100 Subject: [PATCH] Dockerfile and build script --- .cargo/config.toml | 11 +++++++++++ .dockerignore | 1 + Dockerfile | 19 +++++++++++++++++++ build.sh | 3 +++ 4 files changed, 34 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 build.sh diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..288e4ef --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,11 @@ +[target.'cfg(not(target_os = "windows"))'] +rustflags = ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"] + +[target.x86_64-pc-windows-msvc] +linker = "rust-lld" + +[target.i686-pc-windows-msvc] +linker = "rust-lld" + +[target.'cfg(target_env = "musl")'] +rustflags = ["-C", "target-feature=-crt-static"] diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/target diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..57bd51a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:latest + +RUN apt-get update \ + && apt-get install -y --no-install-recommends php-dev +RUN apt-get install -y --no-install-recommends curl ca-certificates libclang-dev + # libssl-dev zlib1g-dev curl git unzip libxml2-dev libpq-dev libzip-dev \ + #libfcgi-bin +USER ubuntu + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y + +WORKDIR /build + +COPY . . + +# Has to run in bash to get the cargo env setup in .bashrc +RUN \ + ./build.sh + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..ba2b663 --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash +. "$HOME/.cargo/env" +cargo build --release