Skip to content

Commit 9ffde7b

Browse files
committed
Dockerfile: Use dockerignore for faster builds
1 parent c5baec6 commit 9ffde7b

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.dockerignore

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#*
2-
!utils/
3-
!build/
1+
.dotnet/
2+
.store/
3+
tools/
4+
build/
5+
src/**/obj/
6+
src/**/node_modules/
7+
tests/**/obj/

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.sh text eol=lf
2+
.dockerignore text eol=lf
23
Dockerfile text eol=lf
34
build.cake text eol=lf
45
distscripts/* eol=lf

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN yarn --cwd src/PokerTime.Web/
4747

4848
# ... run publish
4949
COPY . .
50-
RUN ./build.sh --target=Publish-Ubuntu-18.04-x64 --verbosity=verbose --skip-compression=true
50+
RUN ./build.sh --target=Publish-Ubuntu-18.04-x64 --publish-dir=publish --verbosity=verbose --skip-compression=true
5151

5252
### RUNTIME IMAGE
5353
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1
@@ -58,7 +58,7 @@ COPY utils/install-app-prereqs.sh utils/
5858
RUN bash utils/install-app-prereqs.sh
5959

6060
# ... Copy published app
61-
COPY --from=build /source/build/publish/ubuntu.18.04-x64/ .
61+
COPY --from=build /source/publish/ubuntu.18.04-x64/ .
6262

6363
ENV ASPNETCORE_ENVIRONMENT Production
6464

build.cake

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var baseName = "PokerTime";
2424
var buildDir = Directory("./build");
2525
var testResultsDir = buildDir + Directory("./testresults");
2626
var testArtifactsDir = buildDir + Directory("./testresults/artifacts");
27-
var publishDir = Directory("./build/publish");
27+
var publishDir = Directory(Argument("publish-dir", "./build/publish"));
2828
var assemblyInfoFile = Directory($"./src/{baseName}/Properties") + File("AssemblyInfo.cs");
2929
var nodeEnv = configuration == "Release" ? "production" : "development";
3030
var persistenceProjectPath = Directory($"./src/{baseName}.Persistence");

0 commit comments

Comments
 (0)