Skip to content

Commit

Permalink
Merge pull request #2 from pozgo/develop
Browse files Browse the repository at this point in the history
Updated to 1.0.4 and added live reload support
  • Loading branch information
pozgo authored Dec 2, 2018
2 parents cd4d623 + eb25350 commit c46ca2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM alpine:latest

ENV MKDOCS_VERSION="1.0.3" \
GIT_REPO='false'
ENV MKDOCS_VERSION="1.0.4" \
GIT_REPO='false' \
LIVE_RELOAD_SUPPORT='false'

RUN \
apk add --update \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Workdir is set to `/workdir`
|Variable|Notes|
|:--|:--|
|`GIT_REPO`|Remote git based repository - requires mounted keys *see examples below*|
|`LIVE_RELOAD_SUPPORT`|Support for live reload feature. Default set to `false` - Use if auto reload needed|

### Usage

Expand Down Expand Up @@ -51,6 +52,7 @@ docker run \
-ti \
--name mkdocs \
-e GIT_REPO='[email protected]:username/my-repo.git' \
-e LIVE_RELOAD_SUPPORT='true' \
-v ~/.ssh:/root/.ssh:ro \
polinux/mkdocs
```
Expand Down
7 changes: 6 additions & 1 deletion container-files/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ check_install_status () {
fi
}
start_mkdocs () {
if [[ ${LIVE_RELOAD_SUPPORT} == 'true' ]]; then
LRS='--no-livereload'
else
LRS=''
fi
cd /workdir/mkdocs
echo "Starting MKDocs"
mkdocs serve -a $(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1):8000
mkdocs serve -a $(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1):8000 $LRS
}

get_docs () {
Expand Down

0 comments on commit c46ca2c

Please sign in to comment.