Dockerfile and build script

This commit is contained in:
Alex Wright 2026-04-01 22:42:46 +01:00
parent 3697975728
commit 8d3190c343
4 changed files with 34 additions and 0 deletions

11
.cargo/config.toml Normal file
View File

@ -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"]

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
/target

19
Dockerfile Normal file
View File

@ -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

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
. "$HOME/.cargo/env"
cargo build --release