Add files

This commit is contained in:
Lilith Ashley Nyx Arson 🔥 2024-11-07 14:25:53 +01:00
parent a76f6a2196
commit af97c5f829
Signed by: lilith
SSH key fingerprint: SHA256:LAjgsAMyT3LO2JVtr6fQ4N3RTYoRRlIm5wAKsbDife4
8 changed files with 78 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
target/

21
Dockerfile Normal file
View file

@ -0,0 +1,21 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY BUILD.SH
# TO MODIFY DOCKERFILES, SEE THE DIRECTORY NAMED "dockerfiles"\n
# dockerfiles/00-base
FROM debian AS base
RUN apt update
RUN --mount=type=cache,target=/var/cache apt install -y build-essential libssl-dev zlib1g-dev autoconf
# dockerfiles/02-final
FROM busybox:glibc
COPY tini /tini
COPY utils/http-server-rs/target/release/http-server /bin
COPY --from=base /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib
RUN mkdir -p /srv/repo
EXPOSE 8000
CMD ["http-server", "--chdir", "/srv/repo"]
ENTRYPOINT ["/tini", "--"]

View file

@ -1,2 +1,2 @@
# mini-fdroid
smallest possible fdroid server container
# minhttpd
tiny http server, made to mimic* the usability of "python -m http.server"

38
build.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash
set -e
echo "# THIS FILE IS AUTOMATICALLY GENERATED BY BUILD.SH" >Dockerfile
echo "# TO MODIFY DOCKERFILES, SEE THE DIRECTORY NAMED \"dockerfiles\"\n" >>Dockerfile
for f in dockerfiles/*; do
echo -e "\n# $f" >>Dockerfile
cat $f >>Dockerfile
done
if ! command -v cargo 2 >&1 >/dev/null; then
echo "[*] Rust is not installed"
exit 0
fi
for f in utils/*; do
echo "Building $(basename $f)..."
pushd $f
cargo build -r
popd
done
CMD=""
if command -v podman 2 >&1 >/dev/null; then
echo "[*] Using podman"
CMD="podman"
elif command -v docker 2 >&1 >/dev/null; then
echo "[*] Using docker"
CMD="docker"
else
echo "[!] No CMD parser installed."
exit 1
fi
$CMD build . -t arson.pw/minhttpd

3
dockerfiles/00-base Normal file
View file

@ -0,0 +1,3 @@
FROM debian AS base
RUN apt update
RUN --mount=type=cache,target=/var/cache apt install -y build-essential libssl-dev zlib1g-dev autoconf

12
dockerfiles/01-server Normal file
View file

@ -0,0 +1,12 @@
FROM busybox:glibc
COPY tini /tini
COPY utils/http-server-rs/target/release/http-server /bin
COPY --from=base /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib
RUN mkdir -p /srv/repo
EXPOSE 8000
CMD ["http-server", "--chdir", "/srv/repo"]
ENTRYPOINT ["/tini", "--"]

BIN
tini Executable file

Binary file not shown.

1
utils/http-server-rs Submodule

@ -0,0 +1 @@
Subproject commit 1a5cee437c8bc580251f563f7c216a787264da2e