-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (30 loc) · 1.01 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Visual Studio Optimized Dockerfile
# Base image to run the app
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# Builder image to compile and build the project
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
# Install necessary packages
RUN dotnet tool install -g Microsoft.Web.LibraryManager.Cli
RUN dotnet tool install -g Excubo.WebCompiler
ENV PATH="${PATH}:/root/.dotnet/tools"
# Change work directory
WORKDIR /src
# Copy project source
COPY . .
# Restore package dependencies
RUN dotnet restore ./Venjix.csproj
RUN libman restore
RUN webcompiler wwwroot/scss/venjix.scss -o wwwroot/css/ -z disable
# Compile and build the project
RUN dotnet build Venjix.csproj -c Release -o /app/build
# Publish project
FROM build AS publish
RUN dotnet publish Venjix.csproj -c Release -o /app/publish
# Build final image and run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Venjix.dll"]