-
Notifications
You must be signed in to change notification settings - Fork 2
/
local.Dockerfile
52 lines (42 loc) · 1.78 KB
/
local.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
41
42
43
44
45
46
47
48
49
50
51
52
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env
################################################################
# Install node.js v10.x
#
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt update \
&& apt install -y nodejs
################################################################
# Cache layer with package.json for node_modules
#
ADD ./DevActivator/package.json ./DevActivator/npm-shrinkwrap.json ./tmp/
RUN cd /tmp \
&& npm i npm@latest -g \
&& npm ci
################################################################
# Cache layer with NuGet.Config and *.csproj for nuget packages
#
COPY ./DevActivator.Common.BL/DevActivator.Common.BL.csproj ./app/DevActivator.Common.BL/
COPY ./DevActivator.Common.DAL/DevActivator.Common.DAL.csproj ./app/DevActivator.Common.DAL/
COPY ./DevActivator.Meetups.BL/DevActivator.Meetups.BL.csproj ./app/DevActivator.Meetups.BL/
COPY ./DevActivator.Meetups.DAL/DevActivator.Meetups.DAL.csproj ./app/DevActivator.Meetups.DAL/
COPY ./DevActivator.Meetups.Tests/DevActivator.Meetups.Tests.csproj ./app/DevActivator.Meetups.Tests/
COPY ./DevActivator/DevActivator.csproj ./app/DevActivator/
COPY ./ElectronNetAngular.sln ./app/
RUN cd /app \
&& dotnet restore \
&& mkdir -p /home/app \
&& cp -a /app /home
################################################################
# Copy everything else and build
#
COPY . /home/app
RUN cp -a /tmp/node_modules /home/app/DevActivator
WORKDIR /home/app/DevActivator
RUN dotnet publish -c Debug -o out --no-restore --no-dependencies
################################################################
# Build runtime image
#
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1
WORKDIR /home/app
COPY --from=build-env /home/app/DevActivator/out .
ENTRYPOINT ["dotnet", "DevActivator.dll"]