-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 741 Bytes
/
Dockerfile
File metadata and controls
25 lines (19 loc) · 741 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
# Easiest to put Dockerfile for Web/ in the root directory:
# https://github.com/dotnet/dotnet-docker/tree/main/samples/complexapp
ARG DOTNET_OS_VERSION="-alpine"
ARG DOTNET_SDK_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_SDK_VERSION}${DOTNET_OS_VERSION} AS build
WORKDIR /src/
COPY ./Web ./Web
COPY ./Lib ./Lib
WORKDIR /src/Web
RUN dotnet restore
RUN dotnet publish -c Release -o /app
# MAYBE add a unit test layer, once linux OS is supported: https://github.com/darthwalsh/dotNetBytes/compare/main...linux
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_SDK_VERSION}
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Production
EXPOSE 8080
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT [ "dotnet", "Web.dll" ]