Skip to content

Commit

Permalink
Add docker-compose.yml file
Browse files Browse the repository at this point in the history
To run the site in docker is now a single command.
  • Loading branch information
MartinsRui committed Aug 9, 2017
1 parent 162565b commit a65bad5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ VOLUME /src
EXPOSE 4000

WORKDIR /src
ENTRYPOINT ["jekyll"]

ENTRYPOINT ["jekyll", "serve", "-H", "0.0.0.0"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '2'
services:
server:
build:
context: .
dockerfile: Dockerfile
image: result/latest
ports:
- "4000:4000"
volumes:
- ".:/src"
9 changes: 2 additions & 7 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,11 @@ If you want to shorten this long command, you can put this code in a file such a
## Running the site in Docker

You can also use Docker to directly build and run the site on your local machine. Just clone the repo and run the following from your working dir:

```
docker build --no-cache -t mydocs .
docker-compose up -d
```
The site should now be running at [http://localhost:4000/](http://localhost:4000/).

Once the build is complete, you can mount and run the whole site as follows:

```
docker run -v "$PWD:/src" -p 4000:4000 mydocs serve -H 0.0.0.0
```
This is perhaps the easiest way to see how your site would actually look.

## Configure the sidebar
Expand Down

0 comments on commit a65bad5

Please sign in to comment.