Hotfix/docker file permissions (#350)

* Fixed file pathing for automated docker builds

* Added back in renaming the Kavita executable

* Testing new method for copying wwwroot folder

* Fixed file pathing

* Fixed pathing to test

* Potential fix for Docker file permissions

Co-authored-by: Chris Plaatjes <chris.p@boxbrite.com>
Co-authored-by: Boxbrite User <boxbrite@Rathalos.localdomain>
This commit is contained in:
Kizaing 2021-06-30 16:46:05 -04:00 committed by GitHub
parent 20ba41c38f
commit f7f983045d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 29 deletions

View File

@ -1,4 +1,4 @@
name: CI to Docker Hub name: Build Nightly Docker
on: on:
push: push:
@ -25,8 +25,6 @@ jobs:
with: with:
node-version: '14' node-version: '14'
- run: | - run: |
echo 'Checking folder structure'
ls -l
cd Kavita-webui/ || exit cd Kavita-webui/ || exit
echo 'Installing web dependencies' echo 'Installing web dependencies'
@ -35,14 +33,9 @@ jobs:
echo 'Building UI' echo 'Building UI'
npm run prod npm run prod
echo 'Checking dist folder for compiling integrity'
ls -l dist
echo 'Copying back to Kavita wwwroot' echo 'Copying back to Kavita wwwroot'
rsync -a dist/ ../API/wwwroot/ rsync -a dist/ ../API/wwwroot/
echo 'Checking Kavita wwwroot for copying integrity'
ls -l ../API/wwwroot
cd ../ || exit cd ../ || exit
- name: Compile dotnet app - name: Compile dotnet app

View File

@ -1,4 +1,4 @@
name: CI to Docker Hub name: Build Stable Docker
on: on:
push: push:
@ -25,20 +25,17 @@ jobs:
with: with:
node-version: '14' node-version: '14'
- run: | - run: |
echo 'Removing old wwwroot'
rm -rf API/wwwroot/*
cd Kavita-webui/ || exit cd Kavita-webui/ || exit
echo 'Installing web dependencies' echo 'Installing web dependencies'
npm install npm install
echo 'Building UI' echo 'Building UI'
npm run prod npm run prod
echo 'Checking dist folder for compiling integrity'
ls -l dist
echo 'Copying back to Kavita wwwroot' echo 'Copying back to Kavita wwwroot'
mkdir ../API/wwwroot rsync -a dist/ ../API/wwwroot/
cp -r dist/* ../API/wwwroot
echo 'Checking Kavita wwwroot for copying integrity'
ls -l ../API/wwwroot
cd ../ || exit cd ../ || exit
- name: Compile dotnet app - name: Compile dotnet app
@ -72,9 +69,6 @@ jobs:
- name: Image digest - name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} run: echo ${{ steps.docker_build.outputs.digest }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Notify Discord - name: Notify Discord
uses: rjstone/discord-webhook-notify@v1 uses: rjstone/discord-webhook-notify@v1
with: with:

View File

@ -1,6 +1,6 @@
#This Dockerfile creates a build for all architectures #This Dockerfile creates a build for all architectures
#Production image #Image that copies in the files and passes them to the main image
FROM ubuntu:focal AS copytask FROM ubuntu:focal AS copytask
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -8,12 +8,15 @@ ARG TARGETPLATFORM
#Move the output files to where they need to be #Move the output files to where they need to be
RUN mkdir /files RUN mkdir /files
COPY _output/*.tar.gz /files/ COPY _output/*.tar.gz /files/
COPY Kavita-webui/dist /files/wwwroot
COPY copy_runtime.sh /copy_runtime.sh COPY copy_runtime.sh /copy_runtime.sh
RUN /copy_runtime.sh RUN /copy_runtime.sh
#Production image
FROM ubuntu:focal FROM ubuntu:focal
COPY --from=copytask /kavita /kavita COPY --from=copytask /Kavita /kavita
COPY --from=copytask /files/wwwroot /kavita/wwwroot
#Installs program dependencies #Installs program dependencies
RUN apt-get update \ RUN apt-get update \

View File

@ -7,13 +7,10 @@ set -xv
if [ "$TARGETPLATFORM" == "linux/amd64" ] if [ "$TARGETPLATFORM" == "linux/amd64" ]
then then
tar xf /files/kavita-linux-x64.tar.gz -C / tar xf /files/kavita-linux-x64.tar.gz -C /
mv /Kavita /kavita
elif [ "$TARGETPLATFORM" == "linux/arm/v7" ] elif [ "$TARGETPLATFORM" == "linux/arm/v7" ]
then then
tar xf /files/kavita-linux-arm.tar.gz -C / tar xf /files/kavita-linux-arm.tar.gz -C /
mv /Kavita /kavita
elif [ "$TARGETPLATFORM" == "linux/arm64" ] elif [ "$TARGETPLATFORM" == "linux/arm64" ]
then then
tar xf /files/kavita-linux-arm64.tar.gz -C / tar xf /files/kavita-linux-arm64.tar.gz -C /
mv /Kavita /kavita
fi fi

View File

@ -13,7 +13,7 @@ then
rm /kavita/appsettings.json rm /kavita/appsettings.json
ln -s /kavita/data/appsettings.json /kavita/ ln -s /kavita/data/appsettings.json /kavita/
else else
mv /kavita/appsettings.json /kavita/data/ mv /kavita/appsettings.json /kavita/data/ || true
ln -s /kavita/data/appsettings.json /kavita/ ln -s /kavita/data/appsettings.json /kavita/
fi fi
@ -55,11 +55,11 @@ then
else else
if [ -d /kavita/data/logs ] if [ -d /kavita/data/logs ]
then then
touch /kavita/data/logs/kavita.log echo "" > /kavita/data/logs/kavita.log || true
ln -s /kavita/data/logs/kavita.log /kavita/ ln -s /kavita/data/logs/kavita.log /kavita/
else else
mkdir /kavita/data/logs mkdir /kavita/data/logs
touch /kavita/data/logs/kavita.log echo "" > /kavita/data/logs/kavita.log || true
ln -s /kavita/data/logs/kavita.log /kavita/ ln -s /kavita/data/logs/kavita.log /kavita/
fi fi