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:
push:
@ -25,8 +25,6 @@ jobs:
with:
node-version: '14'
- run: |
echo 'Checking folder structure'
ls -l
cd Kavita-webui/ || exit
echo 'Installing web dependencies'
@ -35,14 +33,9 @@ jobs:
echo 'Building UI'
npm run prod
echo 'Checking dist folder for compiling integrity'
ls -l dist
echo 'Copying back to Kavita wwwroot'
rsync -a dist/ ../API/wwwroot/
echo 'Checking Kavita wwwroot for copying integrity'
ls -l ../API/wwwroot
cd ../ || exit
- name: Compile dotnet app

View File

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

View File

@ -1,6 +1,6 @@
#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
ARG TARGETPLATFORM
@ -8,12 +8,15 @@ ARG TARGETPLATFORM
#Move the output files to where they need to be
RUN mkdir /files
COPY _output/*.tar.gz /files/
COPY Kavita-webui/dist /files/wwwroot
COPY copy_runtime.sh /copy_runtime.sh
RUN /copy_runtime.sh
#Production image
FROM ubuntu:focal
COPY --from=copytask /kavita /kavita
COPY --from=copytask /Kavita /kavita
COPY --from=copytask /files/wwwroot /kavita/wwwroot
#Installs program dependencies
RUN apt-get update \

View File

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

View File

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