forked from ShokoAnime/ShokoServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.aarch64
56 lines (41 loc) · 1.99 KB
/
Dockerfile.aarch64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG version
ARG channel
ARG commit
ARG tag
ARG date
#MAINTAINER Cayde Dixon <[email protected]>
RUN mkdir -p /usr/src/app/source /usr/src/app/build
COPY . /usr/src/app/source
WORKDIR /usr/src/app/source
# maxcpucount added because we were facing this issue -> https://github.com/dotnet/sdk/issues/2902
RUN dotnet build -c=Release -f net8.0 -o=/usr/src/app/build/ -r=linux-arm64 Shoko.CLI/Shoko.CLI.csproj /p:Version="${version}" /p:InformationalVersion="\"channel=${channel},commit=${commit},tag=${tag},date=${date},\"" /maxcpucount:1
FROM mcr.microsoft.com/dotnet/aspnet:8.0
ENV PUID=1000 \
PGID=100 \
LANG=C.UTF-8 \
LC_CTYPE=C.UTF-8 \
LC_ALL=C.UTF-8
ARG channel
RUN apt-get update && apt-get install -y gnupg curl
RUN curl https://mediaarea.net/repo/deb/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://mediaarea.net/repo/deb/debian/ bookworm main" | tee -a /etc/apt/sources.list
RUN apt-get update && apt-get install -y apt-utils gosu jq unzip mediainfo librhash-dev
WORKDIR /usr/src/app/build
COPY --from=build /usr/src/app/build .
COPY ./dockerentry.sh /dockerentry.sh
# Create a sub-scope where we navigate to the web ui directory, then download the needed web ui archive, extract it, and remove the archive.
RUN (\
cd /usr/src/app/build/webui;\
if [ "${channel:-dev}" = "stable" ]; then\
curl -L $(curl https://api.github.com/repos/ShokoAnime/Shoko-WebUI/releases/latest | jq -r '.assets[0].browser_download_url') -o latest.zip;\
else\
curl -L $(curl https://api.github.com/repos/ShokoAnime/Shoko-WebUI/releases | jq -r '.[0].assets[0].browser_download_url') -o latest.zip;\
fi;\
unzip -o latest.zip;\
rm latest.zip\
)
VOLUME /home/shoko/.shoko/
HEALTHCHECK --start-period=5m CMD curl -H "Content-Type: application/json" -H 'Accept: application/json' 'http://localhost:8111/api/v3/Init/Status' || exit 1
EXPOSE 8111
ENTRYPOINT /bin/bash /dockerentry.sh