Skip to content
Permalink
Browse files

Add docker multi-stage

  • Loading branch information...
hidden4003 committed Sep 11, 2019
1 parent b160180 commit 5408db1f87d1f2f2db0b9d8f8e5963563090ccb2
Showing with 27 additions and 9 deletions.
  1. +27 −9 Dockerfile
@@ -1,36 +1,54 @@
FROM mono:5.20
FROM mono:6.0

#MAINTAINER Cayde Dixon <me@cazzar.net>
ENV PUID=1000 \
PGID=100
PGID=100 \
TargetFrameworkDirectory=/usr/lib/mono/

RUN apt-get update && apt-get install -y --force-yes gnupg curl
RUN apt-get install apt
RUN apt-get update && apt-get install -y gnupg curl wget

RUN curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | apt-key add -
RUN echo "deb http://dl.bintray.com/cazzar/shoko-deps jesse main" | tee -a /etc/apt/sources.list
RUN echo "deb http://ftp.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list

RUN apt-get update && apt-get install -y --force-yes libmediainfo0v5 librhash0 sqlite.interop jq unzip && apt-get install -y --force-yes -t stretch-backports gosu
RUN apt-get update && apt-get install -y apt-utils libmediainfo0v5 librhash0 sqlite.interop jq unzip libunwind-dev apt-transport-https && apt-get install -y -t stretch-backports gosu

RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 2.2

RUN mkdir -p /usr/src/app/source /usr/src/app/build
COPY . /usr/src/app/source
WORKDIR /usr/src/app/source
RUN mv /usr/src/app/source/dockerentry.sh /dockerentry.sh

ADD https://github.com/NuGet/Home/releases/download/3.3/NuGet.exe .
RUN mono NuGet.exe restore
RUN xbuild /property:Configuration=CLI /property:OutDir=/usr/src/app/build/
#ADD https://github.com/NuGet/Home/releases/download/3.3/NuGet.exe .
RUN nuget restore
RUN msbuild /property:Configuration=CLI /property:OutDir=/usr/src/app/build/
RUN rm -rf /usr/src/app/source
RUN rm /usr/src/app/build/System.Net.Http.dll

FROM mono:6.0
ENV PUID=1000 \
PGID=100

RUN apt-get install apt
RUN apt-get update && apt-get install -y gnupg curl wget

RUN curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | apt-key add -
RUN echo "deb http://dl.bintray.com/cazzar/shoko-deps jesse main" | tee -a /etc/apt/sources.list
RUN echo "deb http://ftp.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list

RUN apt-get update && apt-get install -y apt-utils libmediainfo0v5 librhash0 sqlite.interop jq unzip libunwind-dev apt-transport-https && apt-get install -y -t stretch-backports gosu

WORKDIR /usr/src/app/build
COPY --from=0 /usr/src/app/build .

WORKDIR /usr/src/app/build/webui
#RUN curl -L $(curl https://api.github.com/repos/ShokoAnime/ShokoServer-WebUI/releases | jq -r '. | map(select(.prerelease==false)) | .[0].assets[0].browser_download_url') -o latest.zip
RUN curl -L $(curl https://api.github.com/repos/ShokoAnime/ShokoServer-WebUI/releases | jq -r '.[0].assets[0].browser_download_url') -o latest.zip
RUN unzip -o latest.zip
RUN rm latest.zip

WORKDIR /usr/src/app/build

VOLUME /home/shoko/.shoko/
VOLUME /usr/src/app/build/webui

0 comments on commit 5408db1

Please sign in to comment.
You can’t perform that action at this time.