mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 09:18:08 +00:00
Alpine image working
This commit is contained in:
@@ -1,29 +1,35 @@
|
|||||||
FROM microsoft/dotnet:2.1-sdk as build-env
|
FROM microsoft/dotnet:2.1-sdk-alpine AS build
|
||||||
# FROM microsoft/aspnetcore-build:2.1.300-preview2-stretch AS build-env
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy csproj and restore as distinct layers
|
# copy csproj and restore as distinct layers
|
||||||
COPY *.csproj ./
|
COPY *.csproj .
|
||||||
COPY NuGet.config ./
|
|
||||||
RUN dotnet restore \
|
RUN dotnet restore \
|
||||||
--source https://api.nuget.org/v3/index.json \
|
--source https://api.nuget.org/v3/index.json \
|
||||||
--source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json \
|
--source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json \
|
||||||
--source https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json \
|
--source https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json \
|
||||||
--source https://www.myget.org/F/sixlabors/api/v3/index.json
|
--source https://www.myget.org/F/sixlabors/api/v3/index.json
|
||||||
|
|
||||||
# Copy everything else and build
|
# copy everything else and build app
|
||||||
COPY . ./
|
COPY . .
|
||||||
|
WORKDIR /app/
|
||||||
|
RUN dotnet build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
WORKDIR /app
|
||||||
RUN dotnet publish -c Release -o out
|
RUN dotnet publish -c Release -o out
|
||||||
|
|
||||||
# Build runtime image
|
|
||||||
FROM microsoft/dotnet:2.1-aspnetcore-runtime
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=build-env /app/out .
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/out ./
|
||||||
|
# ln -s /usr/lib/libuv.so.1 /usr/lib/libuv.so && \
|
||||||
|
|
||||||
|
RUN apk add --no-cache --update \
|
||||||
python \
|
python \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
curl && \
|
libuv \
|
||||||
|
curl \
|
||||||
|
curl-dev && \
|
||||||
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && \
|
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && \
|
||||||
chmod a+rx /usr/local/bin/youtube-dl && \
|
chmod a+rx /usr/local/bin/youtube-dl && \
|
||||||
youtube-dl -U
|
youtube-dl -U
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
FROM microsoft/dotnet:2.1.300-preview2-sdk-alpine AS build
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# copy csproj and restore as distinct layers
|
|
||||||
COPY *.csproj .
|
|
||||||
RUN dotnet restore \
|
|
||||||
--source https://api.nuget.org/v3/index.json \
|
|
||||||
--source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json \
|
|
||||||
--source https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json \
|
|
||||||
--source https://www.myget.org/F/sixlabors/api/v3/index.json
|
|
||||||
|
|
||||||
# copy everything else and build app
|
|
||||||
COPY . .
|
|
||||||
WORKDIR /app/
|
|
||||||
RUN dotnet build
|
|
||||||
|
|
||||||
FROM build AS publish
|
|
||||||
WORKDIR /app
|
|
||||||
RUN dotnet publish -c Release -o out
|
|
||||||
|
|
||||||
|
|
||||||
FROM microsoft/dotnet:2.1.0-preview2-aspnetcore-runtime-alpine AS runtime
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=publish /app/out ./
|
|
||||||
# ln -s /usr/lib/libuv.so.1 /usr/lib/libuv.so && \
|
|
||||||
|
|
||||||
RUN apk add --no-cache --update \
|
|
||||||
python \
|
|
||||||
ffmpeg \
|
|
||||||
libuv \
|
|
||||||
curl \
|
|
||||||
curl-dev && \
|
|
||||||
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && \
|
|
||||||
chmod a+rx /usr/local/bin/youtube-dl && \
|
|
||||||
youtube-dl -U
|
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "PodNoms.Api.dll"]
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<PackageReference Include="Hangfire" Version="1.6.17" />
|
<PackageReference Include="Hangfire" Version="1.6.17" />
|
||||||
<PackageReference Include="Hangfire.MemoryStorage" Version="1.5.2" />
|
<PackageReference Include="Hangfire.MemoryStorage" Version="1.5.2" />
|
||||||
<PackageReference Include="Lib.Net.Http.WebPush" Version="1.3.0" />
|
<PackageReference Include="Lib.Net.Http.WebPush" Version="1.3.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-preview2-final" />
|
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
|
||||||
<PackageReference Include="AutoMapper" Version="6.2.2" />
|
<PackageReference Include="AutoMapper" Version="6.2.2" />
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
|
||||||
<PackageReference Include="Handlebars.NetStandard" Version="1.8.1" />
|
<PackageReference Include="Handlebars.NetStandard" Version="1.8.1" />
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-dev001179" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-dev001179" />
|
||||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.10-pre20180223200113" />
|
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.10-pre20180223200113" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.3.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.3.0" />
|
||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0-preview2-26406-04" />
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0-rc1" />
|
||||||
<PackageReference Include="WindowsAzure.Storage" Version="8.2.1" />
|
<PackageReference Include="WindowsAzure.Storage" Version="8.2.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user