From 7d9e71c86647024f724888ae0855dfd13877041c Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 29 Apr 2021 22:33:43 -0700 Subject: [PATCH] + Adding python3, pip, and virtualenv to dependancies - Removing mysql client since we don't need it for what we're doing - Removing diesel since it's been replaced with a simpler shell script(that's totally not flaky) ! Try at some point to reduce all this crap outside of testing because dep list is getting larger every day --- freechat-pipeline/Dockerfile | 27 +++++++++++++++------------ freechat-pipeline/entrypoint.sh | 5 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/freechat-pipeline/Dockerfile b/freechat-pipeline/Dockerfile index 44b0a96..2c3b8e5 100644 --- a/freechat-pipeline/Dockerfile +++ b/freechat-pipeline/Dockerfile @@ -8,10 +8,18 @@ FROM rust:slim-buster # required for building rust things and grabbing node RUN apt-get update && apt-get upgrade -y && apt-get install \ git default-libmysqlclient-dev pkg-config \ - curl libssl-dev ca-certificates gnupg procps \ + curl libssl-dev ca-certificates gnupg \ + python3 python3-pip \ -y --no-install-recommends +# Install virtualenv as its semi-required for python packages in freechat +# This is a (very) small goal: removing all python dependancies outside of testing +# Because frankly Rust binaries + Node BS + Python is just too awful to maintain +RUN pip3 install virtualenv + +# Setup python3 as required for the mock client + # Setup node # grab key RUN curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - @@ -21,17 +29,12 @@ RUN echo "deb-src https://deb.nodesource.com/node_14.x sid main" >> /etc/apt/sou RUN apt-get update && apt-get install nodejs \ -y --no-install-recommends -# Next we install diesel for easily setting up the database tables -RUN cargo install diesel_cli --no-default-features --features mysql - -# Now comes the painful part of setting mysql itself -# Database user will be 'admin'@'localhost' identified by 'password' -# Database name is 'freechat' -# Tables should be setup for us by diesel -# Also I'm using expect because of the amount of interactive prompts in the way -RUN apt-get install curl expect \ - -y --no-install-recommends +# Mysql setup +# NOTE: Keep in mind that because I'm basically throwing security out the window +# with this docker that we're mostly just using Mysql's default everything +# Later on in another script we setup a proper user to interface with sql but still, +# nothing here is to be used in prod(once again) RUN mkdir /opt/mysql-setup RUN curl "https://repo.mysql.com//mysql-apt-config_0.8.17-1_all.deb" \ -o /opt/mysql-setup/mysql-apt-config_0.8.17-1_all.deb @@ -43,7 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ # Use the newly installed mysql packages to install the server component RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ - apt-get install mysql-community-client mysql-community-server \ + apt-get install mysql-community-server \ -y --no-install-recommends diff --git a/freechat-pipeline/entrypoint.sh b/freechat-pipeline/entrypoint.sh index 8a3e018..42448c6 100755 --- a/freechat-pipeline/entrypoint.sh +++ b/freechat-pipeline/entrypoint.sh @@ -1,7 +1,6 @@ #!/bin/bash -echo Starting mysql server in background -mysqld --user=root --daemonize& -echo Starting shell +# Basically just yeet this to the back because we don't exactly care about it +mysqld --user=root --daemonize > /dev/null 2>&1 & bash