Add docker-compose.yml file
To run the site in docker is now a single command.
This commit is contained in:
parent
162565bccd
commit
a65bad570b
@ -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
11
docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: '2'
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: result/latest
|
||||
ports:
|
||||
- "4000:4000"
|
||||
volumes:
|
||||
- ".:/src"
|
13
index.md
13
index.md
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user