-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
26 lines (20 loc) · 858 Bytes
/
Dockerfile
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
# use an official microsoft SDK as a parent image
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
# set our working directory to /app
WORKDIR /app
# copy the working directory contents into the container at /app
COPY . .
# copy a dummy appsettings.json file in, since this file is secret
COPY config/appsettings-sample.json /app/config/appsettings.json
# build and put files in a folder called output
RUN dotnet build -c Release -o output
# Build runtime image. Note use of runtime version of core image to reduce size of final image
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime-env
WORKDIR /app
COPY --from=build-env app/output .
# create an empty directory for downloaded data
RUN mkdir /app/Data
# Once the container launches, run the console
ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
ENTRYPOINT ["dotnet", "dotnet-roslyn-dynamic-api.dll"]