Skip to content

Commit

Permalink
Hotfix/docker file permissions (Kareadita#350)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Boxbrite User <[email protected]>
  • Loading branch information
3 people authored Jun 30, 2021
1 parent 20ba41c commit f7f9830
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 29 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/nightly-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI to Docker Hub
name: Build Nightly Docker

on:
push:
Expand All @@ -25,8 +25,6 @@ jobs:
with:
node-version: '14'
- run: |
echo 'Checking folder structure'
ls -l
cd Kavita-webui/ || exit
echo 'Installing web dependencies'
Expand All @@ -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
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/stable-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI to Docker Hub
name: Build Stable Docker

on:
push:
Expand All @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#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

#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 \
Expand Down
3 changes: 0 additions & 3 deletions copy_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit f7f9830

Please sign in to comment.