diff --git a/.vscode/settings.json b/.vscode/settings.json index e8b4117..0b64f86 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,7 +14,8 @@ "readme", "meta", "global", - "deps-dev" + "deps-dev", + "docker" ], "conventionalCommits.autoCommit": false, "conventionalCommits.promptCI": true, diff --git a/docker/Dockerfile b/docker/Dockerfile index f44fd46..0ad6a79 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,20 @@ FROM squidfunk/mkdocs-material # https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#linux but for Alpine -RUN apk add \ +RUN apk add --no-cache \ cairo-dev \ freetype-dev \ libffi-dev \ jpeg-dev \ libpng-dev \ - zlib-dev + zlib-dev \ + bash \ + coreutils RUN pip3 install \ mkdocs-git-revision-date-localized-plugin \ pillow \ - cairosvg \ No newline at end of file + cairosvg + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] +CMD [ "serve" ] \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..d421cea --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +if [[ $DEBUG != "" ]]; then + set -x +fi + +if [[ $1 = "serve" ]] || [[ $1 == "build" ]] | [[ $1 == "gh-deploy" ]] || [[ $1 == "new" ]]; then + exec mkdocs $@ +else + $@ +fi