This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
generated from homecentr/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
210 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 1 | ||
update_configs: | ||
- package_manager: "docker" | ||
directory: "/" | ||
update_schedule: "daily" | ||
commit_message: | ||
prefix: "fix" | ||
include_scope: true | ||
- package_manager: "github_actions" | ||
directory: "/" | ||
update_schedule: "daily" | ||
commit_message: | ||
prefix: "ci" | ||
include_scope: true | ||
- package_manager: "java:gradle" | ||
directory: "/tests" | ||
update_schedule: "daily" | ||
commit_message: | ||
prefix: "chore" | ||
include_scope: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
- master | ||
|
||
env: | ||
IMAGE_NAME: "homecentr/$$IMAGE_NAME$$" | ||
IMAGE_NAME: "homecentr/mkdocs" | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
build | ||
.gradletasknamecache | ||
|
||
**/drawio-exporter | ||
|
||
**/.idea/workspace.xml | ||
**/.idea/tasks.xml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
FROM alpine | ||
FROM squidfunk/mkdocs-material:5.1.1 as material | ||
|
||
FROM ubuntu:bionic | ||
|
||
LABEL maintainer="Lukas Holota <[email protected]>" | ||
LABEL io.homecentr.dependency-version=5.1.1 | ||
|
||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
|
||
ADD https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/requirements.txt /tmp/requirements.txt | ||
ADD https://github.com/jgraph/drawio-desktop/releases/download/v12.9.13/draw.io-amd64-12.9.13.deb /tmp/drawio.deb | ||
|
||
COPY --from=material /usr/local/bin/mkdocs /usr/local/bin/mkdocs | ||
|
||
# Install the downloaded package and dependencies required for headless execution | ||
# hadolint ignore=DL3015,DL3008 | ||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends /tmp/drawio.deb -y && \ | ||
apt-get install -y \ | ||
libasound2 \ | ||
xvfb \ | ||
python3-pip \ | ||
git && \ | ||
# Clean up apt cache | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /tmp | ||
|
||
RUN git clone https://github.com/squidfunk/mkdocs-material | ||
|
||
WORKDIR /tmp/mkdocs-material | ||
|
||
RUN pip3 install --no-cache-dir . && \ | ||
pip3 install --no-cache-dir \ | ||
mkdocs-drawio-exporter==0.6.1 \ | ||
mkdocs-minify-plugin==0.3.0 \ | ||
mkdocs-git-revision-date-localized-plugin==0.5.0 \ | ||
mkdocs-awesome-pages-plugin==2.2.1 | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
RUN rm -rf /tmp/** && chmod a+x /entrypoint.sh | ||
|
||
|
||
WORKDIR /docs | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
# HomeCentr - $$IMAGE_NAME$$ | ||
Template repository for Docker container repositories | ||
# HomeCentr - mkdocs | ||
Used to generate the documentation site for Homecentr. The image contains [drawio-exporter](https://github.com/LukeCarrier/mkdocs-drawio-exporter) and all dependencies required for running from command line (i.e. in non-interactive environment). Since the set up is not completely straightforward, I thought it could be also useful to others :) | ||
|
||
## Project status | ||
## Usage | ||
|
||
## Usage (Docker compose) | ||
### Powershell | ||
|
||
### Env. variables | ||
### Exposed ports | ||
```Powershell | ||
docker run --rm -it -p 8000:8000 -v ${$PWD}:/docs homecentr/mkdocs | ||
``` | ||
|
||
### Bash | ||
|
||
## Security | ||
```Bash | ||
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs homecentr/mkdocs | ||
``` | ||
|
||
### Exposed ports | ||
|
||
### Vulnerabilities | ||
| Port | Description | | ||
|------|-------------| | ||
| 8000 | Development server | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
version: "3.7" | ||
services: | ||
$$IMAGE_NAME$$: | ||
mkdocs: | ||
build: . | ||
image: homecentr/$$IMAGE_NAME$$ | ||
image: homecentr/mkdocs:local | ||
volumes: | ||
- ./example:/docs | ||
ports: | ||
- 8000:8000 | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
CMD=${@:-serve --dev-addr=0.0.0.0:8000} | ||
|
||
echo "Running command: xvfb-run -a mkdocs $CMD" | ||
|
||
xvfb-run -a mkdocs $CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
![My alt text](my-diagram.drawio) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile host="Chrome" modified="2020-04-22T11:30:30.410Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36" version="13.0.0" etag="uNaqe1rSSnxSgmKARsH0" type="device"><diagram id="V4NEiOsR98XDe-gOuTpI" name="Page-1">3VZNj5swEP01HFsBbhL22GTTbaVWqpT0Y49ePIBbwyBjAvTX1wSD8bKbdtuVKvUSMc8zw8x74yEe2eXtjaRl9gEZCC/0WeuRay8MV0Gof3ugM8DmagBSydkABRY48B9gQN+gNWdQOY4KUSheumCMRQGxcjAqJTauW4LCfWtJU1gAh5iKJfqFM5UNaLTyLf4WeJqNbw58c5LT0dkAVUYZNjOI7D2yk4hqeMrbHYieu5GXIe7NI6dTYRIK9TsBxyMCu43Lxv+0vTm++6ybDF8QU5vqxoaB6f6NiVJlmGJBxd6iW4l1waDP6mvL+rxHLDUYaPAbKNUZMWmtUEOZyoU51QXL7msf/3I1mrcm3dm4bh2rM9ZQa1/goxQYqMJaxnCh73GUqExBXfALJ6H0gAPmoOvRcRIEVfzk1kHNqKWTn1VDPxhBniDOq38rjiONVer/Eecc+lpK2s0cSuSFqmaZP/aAdjAbLRjvs1lo4ca/J/SQ0co+lfbnk2CaOFFRm7YWo9FkXMGhpGdmG72LXVlpVQ7rMeFtPx7bhAuxQ4HyHE6SBNZxrPFKSfwOsxO2ubrzrcInkArayxovNTEBa5e7YNzyjV2tE7/ZfK2O4LPfsfDXzOos+mvTX66/5JhRiJIHOV7HEdwlz8MxCe4NKFmSHD3AcfR0irVpv1/DrNs/AWT/Ew==</diagram></mxfile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
site_name: Test site | ||
site_description: Mkdocs tests site | ||
site_author: Lukas Holota | ||
site_url: https://www.example.com/ | ||
|
||
nav: | ||
- Index: index.md | ||
|
||
# Configuration | ||
theme: | ||
name: material | ||
language: en | ||
palette: | ||
primary: deep orange | ||
accent: deep orange | ||
font: | ||
text: Roboto | ||
code: Roboto Mono | ||
|
||
plugins: | ||
- drawio-exporter: | ||
# Diagrams are cached to speed up site generation. The default path is | ||
# drawio-exporter, relative to the documentation directory. | ||
cache_dir: 'drawio-exporter' | ||
# Path to the Draw.io executable: | ||
# * drawio on Linux | ||
# * draw.io on macOS | ||
# * or draw.io.exe on Windows | ||
# We'll look for it on your system's PATH, then default installation | ||
# paths. If we can't find it we'll warn you. | ||
drawio_executable: null | ||
# Additional Draw.io CLI args | ||
drawio_args: | ||
- --no-sandbox | ||
# Output format (see draw.io --help | grep format) | ||
format: svg | ||
# Glob pattern for matching source files | ||
sources: '*.drawio' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"name": "homecentr-$$IMAGE_NAME$$", | ||
"name": "homecentr-mkdocs", | ||
"version": "1.0.0", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/homecentr/docker-$$IMAGE_NAME$$.git" | ||
"url": "git+https://github.com/homecentr/docker-mkdocs.git" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/homecentr/docker-$$IMAGE_NAME$$/issues" | ||
"url": "https://github.com/homecentr/docker-mkdocs/issues" | ||
}, | ||
"homepage": "https://github.com/homecentr/docker-$$IMAGE_NAME$$#readme" | ||
"homepage": "https://github.com/homecentr/docker-mkdocs#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
rootProject.name = 'docker-$$IMAGE_NAME$$-tests' | ||
rootProject.name = 'docker-mkdocs-tests' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class MkDocsContainerShould extends ContainerTestBase { | ||
@Test | ||
public void generateSvg() { | ||
File cacheDir = new File(getExporterCachePath().toString()); | ||
File[] files = cacheDir.listFiles(); | ||
|
||
assertTrue(files.length > 0); | ||
} | ||
} |
Empty file.