Add docker-compose.yml file

To run the site in docker is now a single command.
This commit is contained in:
Rui Martins 2017-08-09 09:57:33 +02:00
parent 162565bccd
commit a65bad570b
3 changed files with 16 additions and 11 deletions

View File

@ -22,5 +22,4 @@ VOLUME /src
EXPOSE 4000
WORKDIR /src
ENTRYPOINT ["jekyll"]
ENTRYPOINT ["jekyll", "serve", "-H", "0.0.0.0"]

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '2'
services:
server:
build:
context: .
dockerfile: Dockerfile
image: result/latest
ports:
- "4000:4000"
volumes:
- ".:/src"

View File

@ -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-compose up -d
```
The site should now be running at [http://localhost:4000/](http://localhost:4000/).
```
docker build --no-cache -t mydocs .
```
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