Skip to content

Commit 862c781

Browse files
authored
Merge pull request #71 from danthe1st/docker
improve usability with Docker
2 parents bf94235 + 5476b8d commit 862c781

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ WORKDIR /app
33

44
COPY ["package.json", "./"]
55
COPY ["gulpfile.js", "./"]
6-
COPY ["app", "./app"]
76

87
RUN npm install gulp -g
98
RUN npm install
9+
10+
COPY ["app", "./app"]
11+
1012
RUN gulp build
1113

12-
CMD ["gulp", "serve"]
14+
CMD ["gulp", "serve"]

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ A browser should launch viewing [https://localhost:3000](https://localhost:3000)
8686

8787
### Option 2: Use Docker
8888

89-
1. docker build --tag devjava .
90-
1. docker run --publish 3000:3000 devjava
89+
1. `docker build --tag devjava .`
90+
1. `docker run --publish 3000:3000 --init -it --rm devjava`
9191

9292
You should then be able to open a browser and visit [https://localhost:3000](https://localhost:3000)
9393

94+
(For a more dynamic development experience avoiding a Docker build after every change, you can mount the local /app folder to the container by adding option `-v $PWD/app:/app/app` to your `docker run` command. Note: $PWD may not work in Windows.)
95+
9496

9597
## Working with Content
9698

gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ function serve(done) {
415415
}
416416
});
417417

418-
watch("app/**/*.md", {}, series(build));
419-
watch("app/**/*.html", {}, series(build));
420-
watch("app/scss/*.scss", {}, series(build));
421-
watch("site/**/", {}, browserSync.reload());
418+
watch("app/**/*.md", {interval: 1000, usePolling: true}, series(build));
419+
watch("app/**/*.html", {interval: 1000, usePolling: true}, series(build));
420+
watch("app/scss/*.scss", {interval: 1000, usePolling: true}, series(build));
421+
watch("site/**/", {interval: 1000, usePolling: true}, browserSync.reload());
422422
done();
423423
}
424424

0 commit comments

Comments
 (0)