diff --git a/Docker/init.sh b/Docker/init.sh index 0bd57db2..e94374b3 100644 --- a/Docker/init.sh +++ b/Docker/init.sh @@ -70,13 +70,18 @@ cronKey="$(head -c 1024 < /dev/urandom | sha256sum | awk '{print substr($1,1,29) cd /home/Shinobi mkdir -p libs/customAutoLoad + if [ -e "/config/conf.json" ]; then cp /config/conf.json conf.json elif [ ! -e "./conf.json" ]; then cp conf.sample.json conf.json fi +# Create /config/conf.json if it doesn't exist +if [ ! -e "/config/conf.json" ]; then + node tools/modifyConfiguration.js cpuUsageMarker=CPU subscriptionId=$SUBSCRIPTION_ID thisIsDocker=true pluginKeys="$PLUGIN_KEYS" databaseType="$DB_TYPE" db="$DATABASE_CONFIG" ssl="$SSL_CONFIG" + cp /config/conf.json conf.json +fi sudo sed -i -e 's/change_this_to_something_very_random__just_anything_other_than_this/'"$cronKey"'/g' conf.json -node tools/modifyConfiguration.js cpuUsageMarker=CPU subscriptionId=$SUBSCRIPTION_ID thisIsDocker=true pluginKeys="$PLUGIN_KEYS" db="$DATABASE_CONFIG" ssl="$SSL_CONFIG" echo "=============" diff --git a/Dockerfile b/Dockerfile index 4d2d1e41..a866a9ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ENV DB_USER=majesticflame \ DB_HOST='localhost' \ DB_DATABASE=ccio \ DB_PORT=3306 \ + DB_TYPE='mysql2' \ SUBSCRIPTION_ID=sub_XXXXXXXXXXXX \ PLUGIN_KEYS='{}' \ SSL_ENABLED='false' \ diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index eed0ba2a..c0bc31e4 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -5,6 +5,7 @@ ENV DB_USER=majesticflame \ DB_HOST='localhost' \ DB_DATABASE=ccio \ DB_PORT=3306 \ + DB_TYPE='mysql2' \ SUBSCRIPTION_ID=sub_XXXXXXXXXXXX \ PLUGIN_KEYS='{}' \ SSL_ENABLED='false' \ diff --git a/Dockerfile.nodb b/Dockerfile.nodb new file mode 100644 index 00000000..75aea27f --- /dev/null +++ b/Dockerfile.nodb @@ -0,0 +1,97 @@ +FROM node:16-buster-slim + +ENV DB_USER=majesticflame \ + DB_PASSWORD='' \ + DB_HOST='localhost' \ + DB_DATABASE=ccio \ + DB_PORT=3306 \ + DB_TYPE='mysql2' \ + SUBSCRIPTION_ID=sub_XXXXXXXXXXXX \ + PLUGIN_KEYS='{}' \ + SSL_ENABLED='false' \ + SSL_COUNTRY='CA' \ + SSL_STATE='BC' \ + SSL_LOCATION='Vancouver' \ + SSL_ORGANIZATION='Shinobi Systems' \ + SSL_ORGANIZATION_UNIT='IT Department' \ + SSL_COMMON_NAME='nvr.ninja' \ + DB_DISABLE_INCLUDED=true +ARG DEBIAN_FRONTEND=noninteractive + +RUN mkdir -p /home/Shinobi /config /var/lib/mysql + +RUN apt update -y +RUN apt install wget curl net-tools -y + +# Install FFmpeg + +RUN apt update --fix-missing +RUN apt install -y software-properties-common \ + libfreetype6-dev \ + libgnutls28-dev \ + libmp3lame-dev \ + libass-dev \ + libogg-dev \ + libtheora-dev \ + libvorbis-dev \ + libvpx-dev \ + libwebp-dev \ + libssh2-1-dev \ + libopus-dev \ + librtmp-dev \ + libx264-dev \ + libx265-dev \ + yasm +RUN apt install -y \ + build-essential \ + bzip2 \ + coreutils \ + procps \ + gnutls-bin \ + nasm \ + tar \ + x264 + +RUN apt install -y zip + +RUN apt install -y \ + ffmpeg \ + git \ + make \ + g++ \ + gcc \ + pkg-config \ + python3 \ + wget \ + tar \ + sudo \ + xz-utils + + +WORKDIR /home/Shinobi +COPY . . +#RUN rm -rf /home/Shinobi/plugins +COPY ./plugins /home/Shinobi/plugins +RUN chmod -R 777 /home/Shinobi/plugins +RUN npm i npm@latest -g && \ + npm install --unsafe-perm && \ + npm install pm2 -g +COPY ./Docker/pm2.yml ./ + +RUN npm i pg --save + +# Copy default configuration files +# COPY ./config/conf.json ./config/super.json /home/Shinobi/ +RUN chmod -f +x /home/Shinobi/Docker/init.sh +RUN sed -i -e 's/\r//g' /home/Shinobi/Docker/init.sh +# RUN chmod -f +x /home/Shinobi/shinobi + +VOLUME ["/home/Shinobi/videos"] +VOLUME ["/home/Shinobi/libs/customAutoLoad"] +VOLUME ["/config"] + +EXPOSE 8080 443 21 25 + +ENTRYPOINT ["sh","/home/Shinobi/Docker/init.sh"] + +CMD [ "pm2-docker", "/home/Shinobi/Docker/pm2.yml" ] diff --git a/Dockerfile.nvidia b/Dockerfile.nvidia index 529d41b4..3d8b1a32 100644 --- a/Dockerfile.nvidia +++ b/Dockerfile.nvidia @@ -5,6 +5,7 @@ ENV DB_USER=majesticflame \ DB_HOST='localhost' \ DB_DATABASE=ccio \ DB_PORT=3306 \ + DB_TYPE='mysql2' \ SUBSCRIPTION_ID=sub_XXXXXXXXXXXX \ PLUGIN_KEYS='{}' \ SSL_ENABLED='false' \