mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-04 06:04:39 -04:00
Adding a dockerfile
This commit is contained in:
parent
d5eb5f905a
commit
65cbd3933b
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
transcoder/build
|
||||||
|
Kyoo.WebApp/nodes_modules
|
||||||
|
Kyoo.WebApp/dist
|
||||||
|
Kyoo/bin
|
||||||
|
Kyoo/obj
|
||||||
|
Kyoo.Common/bin
|
||||||
|
Kyoo.Common/obj
|
||||||
|
Kyoo.CommonAPI/bin
|
||||||
|
Kyoo.CommonAPI/obj
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
FROM gcc:latest as transcoder
|
||||||
|
RUN apt-get update && apt-get install -y cmake make
|
||||||
|
WORKDIR /transcoder
|
||||||
|
COPY transcoder .
|
||||||
|
RUN cmake . && make -j
|
||||||
|
|
||||||
|
FROM node:alpine as webapp
|
||||||
|
WORKDIR /webapp
|
||||||
|
COPY Kyoo.WebApp .
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build -- --prod
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 as builder
|
||||||
|
COPY . .
|
||||||
|
RUN dotnet publish -c Release -o /opt/kyoo '-p:SkipWebApp=true;SkipTranscoder=true'
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||||
|
EXPOSE 5000
|
||||||
|
COPY --from=builder /opt/kyoo /usr/lib/kyoo
|
||||||
|
COPY --from=transcoder /transcoder/libtranscoder.so /usr/lib/kyoo
|
||||||
|
COPY --from=webapp /webapp/dist/* /usr/lib/kyoo/wwwroot/
|
||||||
|
CMD ["/usr/lib/kyoo/Kyoo", "/var/lib/kyoo"]
|
||||||
|
|
@ -1 +1 @@
|
|||||||
Subproject commit c72c78989b17f6b92edd7210470ef9cdf24f159f
|
Subproject commit 6b5cd21c2ff44e7bd598ed842e656817948dd23c
|
@ -41,8 +41,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="5.0.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="5.0.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.3" />
|
||||||
@ -56,10 +56,10 @@
|
|||||||
<Content Remove="$(SpaRoot)**" />
|
<Content Remove="$(SpaRoot)**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
|
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish" Condition="'$(SkipWebApp)' != 'true'">
|
||||||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
|
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
|
||||||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
|
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
|
||||||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
|
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition="'$(BuildServerSideRenderer)' == 'true'" />
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DistFiles Include="$(SpaRoot)dist/**; $(SpaRoot)dist-server/**" />
|
<DistFiles Include="$(SpaRoot)dist/**; $(SpaRoot)dist-server/**" />
|
||||||
@ -69,6 +69,11 @@
|
|||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
</ResolvedFileToPublish>
|
</ResolvedFileToPublish>
|
||||||
|
</ItemGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Publish static and login" AfterTargets="ComputeFilesToPublish">
|
||||||
|
<ItemGroup>
|
||||||
<ResolvedFileToPublish Include="@(StaticFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
|
<ResolvedFileToPublish Include="@(StaticFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
|
||||||
<RelativePath>wwwroot/%(StaticFiles.RecursiveDir)%(StaticFiles.Filename)%(StaticFiles.Extension)</RelativePath>
|
<RelativePath>wwwroot/%(StaticFiles.RecursiveDir)%(StaticFiles.Filename)%(StaticFiles.Extension)</RelativePath>
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
@ -81,7 +86,7 @@
|
|||||||
</ResolvedFileToPublish>
|
</ResolvedFileToPublish>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="Prepare the web app" AfterTargets="Build" Condition="$(Configuration) == 'Debug'">
|
<Target Name="Prepare the web app" AfterTargets="Build" Condition="$(Configuration) == 'Debug'">
|
||||||
<Copy SourceFiles="@(StaticFiles)" DestinationFolder="$(OutputPath)/wwwroot/%(RecursiveDir)" />
|
<Copy SourceFiles="@(StaticFiles)" DestinationFolder="$(OutputPath)/wwwroot/%(RecursiveDir)" />
|
||||||
<Copy SourceFiles="@(LoginFiles)" DestinationFolder="$(OutputPath)/wwwroot/%(RecursiveDir)" />
|
<Copy SourceFiles="@(LoginFiles)" DestinationFolder="$(OutputPath)/wwwroot/%(RecursiveDir)" />
|
||||||
@ -92,8 +97,8 @@
|
|||||||
<Exec WorkingDirectory="$(OutputPath)" Command="ln -fs $(ProjectDir)/$(SpaRoot)" />
|
<Exec WorkingDirectory="$(OutputPath)" Command="ln -fs $(ProjectDir)/$(SpaRoot)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="Compile the transcoder" BeforeTargets="BeforeBuild">
|
<Target Name="Compile the transcoder" BeforeTargets="BeforeBuild" Condition="'$(SkipTranscoder)' != 'true'">
|
||||||
<Exec WorkingDirectory="$(TranscoderRoot)" Command="mkdir -p build; cd build; cmake ..; make -j" />
|
<Exec WorkingDirectory="$(TranscoderRoot)" Command='mkdir -p build %26%26 cd build %26%26 cmake .. %26%26 make -j' />
|
||||||
<Copy SourceFiles="$(TranscoderRoot)/build/libtranscoder.so" DestinationFolder="." />
|
<Copy SourceFiles="$(TranscoderRoot)/build/libtranscoder.so" DestinationFolder="." />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1902defd32fa98227acad02dabe7f90ee546ec5b
|
Subproject commit 7bd7e526ee2b489f8674b9f779a11e8ae4959f30
|
Loading…
x
Reference in New Issue
Block a user