diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..559e2bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# This File basically sets up a fresh alpine install with all the things +# required for setting up a new freechat instance + +# First we simply install all the things we may need to build/ +RUN apk add mysql +RUN apk add nginx +RUN cargo +RUN apk add git + +# Now we being the freechat installation process +RUN git clone https://gitlab.com/shockrah/freechat.git/ /opt/freechat/ +RUN cd /opt/freechat/ +RUN sh docker-auto-build.sh + diff --git a/docker-auto-build.sh b/docker-auto-build.sh new file mode 100644 index 0000000..689eddf --- /dev/null +++ b/docker-auto-build.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Building + +cargo_targets="json-api" + +mkdir -p bin/ +# Statically built binaries make this part really easy +for target in $cargo_targets;do + echo ================================================ + echo = = + echo = = + echo = = + echo Building $target + echo = = + echo = = + echo = = + echo ================================================ + pushd $target + cargo build --release + cp target/release/$target ../bin/ + popd +done + + +echo Done building