Skip to content

Commit 6a59a8a

Browse files
committed
Add docker config and instructions
1 parent 20e5e5d commit 6a59a8a

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
.github/

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ruby:2.6-slim
2+
3+
WORKDIR /srv/docs
4+
5+
VOLUME /srv/docs/source
6+
EXPOSE 4567
7+
8+
COPY . /srv/docs
9+
10+
RUN apt-get update \
11+
&& apt-get install -y --no-install-recommends \
12+
build-essential \
13+
nodejs \
14+
&& gem install bundler \
15+
&& bundle install \
16+
&& apt-get remove -y build-essential \
17+
&& apt-get autoremove -y \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
CMD ["bundle", "exec", "middleman", "server", "--watcher-force-polling"]

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@ You can contribute to this documentation by:
1515

1616
> Please **do not submit feature requests or support requests for the REST API** here. You can use the [WooIdeas board](http://ideas.woocommerce.com/forums/133476-woocommerce?category_id=125014) or [Contact SkyVerge support](https://www.skyverge.com/support/).
1717
18-
## Updating pages
19-
20-
This project uses [Slate](https://github.com/lord/slate) for building the documentation pages.
18+
## Running locally
2119

22-
Follow [Slate readme](https://github.com/lord/slate/blob/master/README.md) and [wiki](https://github.com/lord/slate/wiki) for instructions on how to edit files and make changes.
23-
24-
## Deploying an update
25-
26-
To install locally use:
20+
### Vagrant
2721

2822
```shell
2923
bundle install
@@ -37,7 +31,33 @@ Then, to test changes locally run:
3731
bundle exec middleman server
3832
```
3933

40-
Finally, after pushing changes and you are ready to deploy use the script:
34+
### Docker
35+
36+
1. Build the docker image:
37+
```shell
38+
docker build . -t docs
39+
```
40+
1. Start the image:
41+
```shell
42+
docker run -d --rm --name docs -p 4567:4567 -v $(pwd)/build:/srv/docs/build -v $(pwd)/source:/srv/docs/source docs
43+
```
44+
45+
You will be able to access your site at http://localhost:4567.
46+
47+
To build your sources while the container is running, run:
48+
```shell
49+
docker exec -it docs /bin/bash -c "bundle exec middleman build"
50+
```
51+
52+
## Updating pages
53+
54+
This project uses [Slate](https://github.com/lord/slate) for building the documentation pages.
55+
56+
Follow [Slate readme](https://github.com/lord/slate/blob/master/README.md) and [wiki](https://github.com/lord/slate/wiki) for instructions on how to edit files and make changes.
57+
58+
## Deploying an update
59+
60+
After pushing changes and you are ready to deploy use the script:
4161

4262
```shell
4363
bash deploy.sh

0 commit comments

Comments
 (0)