Skip to content

Commit 93f1494

Browse files
committed
Updated docker file
- Seperate node container - Added new Api Build task
1 parent 4765c2e commit 93f1494

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

Dockerfile

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1-
# build container
2-
FROM node:7
1+
# Api Container
32
FROM microsoft/dotnet:2.2-sdk AS build
43
WORKDIR /build
5-
6-
# copy everything
74
COPY . .
85

96
# install dotnet cake tool
107
RUN dotnet tool install -g Cake.Tool
118
ENV PATH="${PATH}:/root/.dotnet/tools"
129

1310
# build, restore and test
14-
RUN dotnet cake build.cake
11+
RUN dotnet cake build.cake --task="Api Publish"
12+
13+
###################################################
14+
15+
# Vue container
16+
FROM node:8 AS client
17+
WORKDIR /client
18+
COPY . .
19+
20+
RUN npm install --prefix ./src/Client/
1521

16-
# runtime container
22+
RUN npm run build --prefix ./src/Client/
23+
24+
###################################################
25+
26+
# Runtime Container
1727
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS runtime
28+
WORKDIR /app
1829

1930
COPY --from=build /build/dist /app
31+
COPY --from=client /client/src/Client/dist /app/wwwroot
32+
2033
WORKDIR /app
2134

2235
EXPOSE 5000
2336

2437
RUN dotnet --list-runtimes
25-
ENTRYPOINT ["dotnet", "Safe.Api.dll"]
38+
ENTRYPOINT ["dotnet", "WebApi.dll"]

build.cake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ Task("Publish")
8383
.IsDependentOn("Publish Client")
8484
.IsDependentOn("Copy Published client into /wwwroot");
8585

86+
Task("Api Publish")
87+
.IsDependentOn("Build project")
88+
.IsDependentOn("Publish Api project");
89+
8690
RunTarget(task);

0 commit comments

Comments
 (0)