Skip to content

Commit c4872d8

Browse files
committed
Add Docker deployment
1 parent a743465 commit c4872d8

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

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

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="intellij-rust.github.io" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
3+
<deployment type="dockerfile">
4+
<settings>
5+
<option name="imageTag" value="intellij-rust.github.io" />
6+
<option name="containerName" value="intellij-rust.github.io" />
7+
<option name="portBindings">
8+
<list>
9+
<DockerPortBindingImpl>
10+
<option name="containerPort" value="8080" />
11+
<option name="hostIp" value="0.0.0.0" />
12+
<option name="hostPort" value="8080" />
13+
</DockerPortBindingImpl>
14+
</list>
15+
</option>
16+
<option name="sourceFilePath" value="Dockerfile" />
17+
<option name="volumeBindings">
18+
<list>
19+
<DockerVolumeBindingImpl>
20+
<option name="containerPath" value="/intellij-rust.github.io/_posts/" />
21+
<option name="hostPath" value="$PROJECT_DIR$/_posts/" />
22+
<option name="readOnly" value="true" />
23+
</DockerVolumeBindingImpl>
24+
<DockerVolumeBindingImpl>
25+
<option name="containerPath" value="/intellij-rust.github.io/assets/posts/" />
26+
<option name="hostPath" value="$PROJECT_DIR$/assets/posts/" />
27+
<option name="readOnly" value="true" />
28+
</DockerVolumeBindingImpl>
29+
</list>
30+
</option>
31+
</settings>
32+
</deployment>
33+
<method v="2" />
34+
</configuration>
35+
</component>

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ruby
2+
3+
RUN apt-get update && apt-get install -y build-essential
4+
5+
COPY . /intellij-rust.github.io
6+
WORKDIR /intellij-rust.github.io
7+
8+
RUN gem install github-pages jekyll jekyll-feed
9+
RUN bundle add webrick
10+
RUN bundle update
11+
RUN bundle install
12+
13+
EXPOSE 8080
14+
15+
WORKDIR /intellij-rust.github.io
16+
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--port", "8080"]

README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Install [Ruby](https://www.ruby-lang.org) and [Bundler](http://bundler.io/).
66
There is `.ruby-version` file for [rbenv](https://github.com/rbenv/rbenv) if you like.
7-
You will probably need GCC, Make, AutoConf and NodeJS installed.
7+
You will probably need GCC, Make, AutoConf and NodeJS installed.
88

99
```bash
1010
$ bundle install
@@ -15,7 +15,7 @@ $ bundle exec jekyll serve --future
1515

1616
If you are using Windows, it's better not to fight with Ruby Installer. I use WSL and works
1717
pretty flawlessly, except file change watching (see
18-
[tracking issue](https://github.com/Microsoft/BashOnWindows/issues/216)). So you'll have to run
18+
[tracking issue](https://github.com/Microsoft/BashOnWindows/issues/216)). So you'll have to run
1919
this instead:
2020

2121
```bash
@@ -28,3 +28,14 @@ To workaround lack of watching, you can do:
2828
$ bundle exec jekyll serve --detach
2929
$ while (bundle exec jekyll build --incremental); do sleep 5; done
3030
```
31+
32+
## Docker
33+
34+
Run `intellij-rust.github.io` configuration directly from IntelliJ IDEA. The website will be accessible at `http://localhost:8080/`.
35+
Any changes made in `_posts` and `assets/posts` will be reflected immediately.
36+
37+
Alternatively, you can use the following commands from the terminal:
38+
```bash
39+
$ docker build -t intellij-rust.github.io .
40+
$ docker run -v $PWD/_posts:/intellij-rust.github.io/_posts -v $PWD/assets/posts:/intellij-rust.github.io/assets/posts -p 8080:8080 -it intellij-rust.github.io
41+
```

0 commit comments

Comments
 (0)