-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 823 Bytes
/
Dockerfile
File metadata and controls
35 lines (26 loc) · 823 Bytes
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
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY /src/GistRun/GistRun.csproj ./
RUN dotnet nuget add source https://www.myget.org/F/servicestack -n myget.org
RUN dotnet restore
COPY /src/GistRun .
RUN dotnet publish -c Release -o /app/publish \
--no-restore
COPY /src/GistRun/NuGet.Config /app/publish
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS final
COPY /src/GistRun/prefetch.sh ./
RUN chmod +x prefetch.sh
RUN ./prefetch.sh
RUN adduser --disabled-password \
--home /app \
--gecos '' deploy && chown -R deploy /app
USER deploy
WORKDIR /app
EXPOSE 5000
COPY --from=build /app/publish .
ENV DOTNET_NOLOGO 1
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV INSPECT_VARS .gistrun/vars.json
ENV ASPNETCORE_URLS http://*:5000
# instruct Kestrel to expose API on port 5000
ENTRYPOINT ["dotnet", "GistRun.dll"]