Moving sample.env into the auto build script and using a reworked freechat docker image on hub.docker.com

This commit is contained in:
shockrah 2021-02-09 19:42:36 -08:00
parent c3d9e2d3b3
commit aa5cd8c4ac
3 changed files with 18 additions and 46 deletions

View File

@ -34,6 +34,23 @@ build_cargo_targets() {
done
}
create_sample_env() {
cat > .env <<EOF
# Mysql key data
DATABASE_NAME=
DATABASE_PASS=
DATABASE_USER=
DATABASE_HOST=
# Server meta things
SERVER_NAME="Freechat Dev Server"
SERVER_DESCRIPTION="Server for sick development things"
SERVER_URL=localhost
SERVER_PORT=8888
EOF
}
show_help() {
@ -66,6 +83,7 @@ if [ $ask_help = "true" ];then
else
# normal building process
build_cargo_targets
create_sample_env
fi

View File

@ -1,35 +0,0 @@
FROM mysql:8.0
# Prelim updates
RUN apt-get update
# Reasoning for each:
# git: Pulling from git remotes
# nginx: reverse proxy + offloading https responsibility to it
# that last point avoids slow loris attacks as nginx is hardened against them
# curl: download rustup setup script
# libmysqlclient-dev: required for building json-api to connect to mysql servers
# build-essential: compiling rust
# libssl-dev: for compiling json-api
RUN apt-get install git nginx \
curl libmysqlclient-dev build-essential \
libssl-dev \
-y --no-install-recommends
# Default rust toolchain
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | \
sh -s -- --default-toolchain=stable
ENV path="/root/.cargo/bin:${PATH}"
# Now we being the freechat installation process
RUN git clone https://gitlab.com/shockrah/freechat.git/ /opt/freechat/
WORKDIR /opt/freechat/
RUN sh docker-auto-build.sh --no-cargo-cache
# Sample env file to copy into the base image
# All keys present but not set to anything(null)
COPY sample.env /opt/freechat/.env

View File

@ -1,11 +0,0 @@
# Mysql key data
DATABASE_NAME=
DATABASE_PASS=
DATABASE_USER=
DATABASE_HOST=
# Server meta things
SERVER_NAME="Freechat Dev Server"
SERVER_DESCRIPTION="Server for sick development things"
SERVER_URL=localhost
SERVER_PORT=8888