зеркало из https://github.com/Azure/draft-classic.git
22 строки
574 B
Docker
22 строки
574 B
Docker
FROM microsoft/dotnet:2.1-sdk AS builder
|
|
WORKDIR /app
|
|
|
|
# caches restore result by copying csproj file separately
|
|
COPY *.csproj .
|
|
RUN dotnet restore
|
|
|
|
COPY . .
|
|
RUN dotnet publish --output /app/ --configuration Release
|
|
RUN sed -n 's:.*<AssemblyName>\(.*\)</AssemblyName>.*:\1:p' *.csproj > __assemblyname
|
|
RUN if [ ! -s __assemblyname ]; then filename=$(ls *.csproj); echo ${filename%.*} > __assemblyname; fi
|
|
|
|
# Stage 2
|
|
FROM microsoft/dotnet:2.1-aspnetcore-runtime
|
|
WORKDIR /app
|
|
COPY --from=builder /app .
|
|
|
|
ENV PORT 80
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT dotnet $(cat /app/__assemblyname).dll
|