Fix Docker image conf.json persistence

merge-requests/3/merge
Moe 2021-06-10 21:21:59 -07:00
parent 05ff09b32f
commit 6511d306fd
2 changed files with 9 additions and 11 deletions

View File

@ -80,13 +80,11 @@ cd /home/Shinobi
mkdir -p libs/customAutoLoad
if [ -e "/config/conf.json" ]; then
cp /config/conf.json conf.json
fi
if [ ! -e "./conf.json" ]; then
sudo cp conf.sample.json conf.json
elif [ ! -e "./conf.json" ]; then
cp conf.sample.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"
sudo cp conf.json /config/conf.json
echo "============="
@ -95,10 +93,8 @@ echo "Default Password : admin"
echo "Log in at http://HOST_IP:SHINOBI_PORT/super"
if [ -e "/config/super.json" ]; then
cp /config/super.json super.json
fi
if [ ! -e "./super.json" ]; then
sudo cp super.sample.json super.json
sudo cp super.sample.json /config/super.json
elif [ ! -e "./super.json" ]; then
cp super.sample.json super.json
fi
if [ -e "/config/init.extension.sh" ]; then

View File

@ -88,13 +88,15 @@ COPY . .
COPY ./plugins /home/Shinobi/plugins
RUN chmod -R 777 /home/Shinobi/plugins
RUN npm i npm@latest -g && \
npm install pm2 -g && \
npm install --unsafe-perm
npm install --unsafe-perm && \
npm install pm2 -g
COPY ./Docker/pm2.yml ./
# 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/plugins"]
@ -104,6 +106,6 @@ VOLUME ["/var/lib/mysql"]
EXPOSE 8080
ENTRYPOINT ["/home/Shinobi/Docker/init.sh"]
ENTRYPOINT ["sh","/home/Shinobi/Docker/init.sh"]
CMD [ "pm2-docker", "pm2.yml" ]