forked from PSW-2020-ORG1/MedbayTech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.Web
42 lines (27 loc) · 1021 Bytes
/
Dockerfile.Web
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
41
42
FROM node:12.2.0 as builder
WORKDIR /app
COPY WebApplicationFrontend/ .
ENV PATH /app/node_modules/.bin:$PATH
COPY WebApplicationFrontend/package.json .
RUN npm install
RUN npm install -g @angular/[email protected]
RUN ng build --prod
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /app
COPY Backend/Backend.csproj Backend/
COPY WebApplication/WebApplication.csproj WebApplication/
RUN dotnet restore WebApplication/WebApplication.csproj
COPY . .
FROM build AS publish
WORKDIR /app/Backend
ENV PATH $PATH:/root/.dotnet/tools
RUN dotnet tool install -g dotnet-ef --version 3.1.9
RUN dotnet ef migrations add Init
WORKDIR /app
COPY --from=builder app/dist/WebApplicationFrontend/ WebApplication/wwwroot/dist/
RUN dotnet publish WebApplication/WebApplication.csproj -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS runtime
RUN useradd -ms /bin/bash defaultuser
WORKDIR /app
COPY --from=publish /app/out .
CMD ASPNETCORE_URLS=http://*:$PORT dotnet WebApplication.dll