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