Skip to content

Commit cbc7e78

Browse files
committed
Improve Docker deployment
Reduce the image size to 1Gb, mount `_site` for better caching, reduce the number of docker image layers
1 parent 9cfa608 commit cbc7e78

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.dockerignore

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
_posts/
2-
assets/
3-
_docs/
4-
_includes/
1+
/.git/
2+
/_site/
3+
/_posts/
4+
/assets/
5+
/_docs/
6+
/_includes/
7+
/.idea/
8+
/*.iml
9+
/README.md

.run/intellij-rust.github.io.run.xml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<option name="hostPath" value="$PROJECT_DIR$/_includes/" />
3737
<option name="readOnly" value="true" />
3838
</DockerVolumeBindingImpl>
39+
<DockerVolumeBindingImpl>
40+
<option name="containerPath" value="/intellij-rust.github.io/_site" />
41+
<option name="hostPath" value="$PROJECT_DIR$/_site/" />
42+
</DockerVolumeBindingImpl>
3943
</list>
4044
</option>
4145
</settings>

Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ RUN apt-get update && apt-get install -y build-essential
55
COPY . /intellij-rust.github.io
66
WORKDIR /intellij-rust.github.io
77

8-
RUN gem install github-pages jekyll jekyll-feed
9-
RUN bundle add webrick
10-
RUN bundle update
11-
RUN bundle install
8+
RUN gem install github-pages jekyll jekyll-feed && bundle add webrick && bundle update && bundle install
129

1310
EXPOSE 8080
1411

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ $ docker run \
4242
-v $PWD/assets:/intellij-rust.github.io/assets \
4343
-v $PWD/_docs:/intellij-rust.github.io/_docs \
4444
-v $PWD/_includes:/intellij-rust.github.io/_includes \
45+
-v $PWD/_site:/intellij-rust.github.io/_site \
4546
-p 8080:8080 -it intellij-rust.github.io
4647
```

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
title: IntelliJ Rust
1010
email: ""
1111
description: Open-source Rust plugin for IntelliJ-based IDEs
12+
repository: intellij-rust/intellij-rust.github.io
1213

1314
collections:
1415
docs:

0 commit comments

Comments
 (0)