Skip to content

Commit 3820214

Browse files
committed
feat: Added docker files and extended README with instructions
1 parent 449e265 commit 3820214

File tree

3 files changed

+76
-27
lines changed

3 files changed

+76
-27
lines changed

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.11-alpine
2+
3+
RUN apk add git
4+
5+
WORKDIR /wiki
6+
COPY requirements.txt .
7+
RUN pip install -U -r requirements.txt
8+
9+
# Force /wiki directory to be considered safe for git
10+
RUN git config --global --add safe.directory /wiki
11+
12+
RUN echo $'#!/bin/sh\n\
13+
cd /wiki\n\
14+
mkdocs serve -a $(hostname -i):8000 --strict' > /docker-entrypoint.sh
15+
16+
RUN chmod +x /docker-entrypoint.sh
17+
18+
ENTRYPOINT ["/docker-entrypoint.sh"]

README.md

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Contributions are very welcome. Here's how you can help:
1616
- Correct spelling / grammar
1717
- Fix links
1818

19-
### Workflow
19+
## Workflow
2020

2121
1. __Fork__ this repo
2222
1. Make changes
@@ -26,6 +26,7 @@ Contributions are very welcome. Here's how you can help:
2626
### Step by step instructions
2727

2828
**NOTE**: The following instructions are targeted towards Unix OS' - needed steps on windows may vary.
29+
2930
**NOTE 2**: You need python3 and python3-venv installed. Please look at your OS' package manager to find the correct packages.
3031

3132
1. At first: Fork the repository to your account!
@@ -42,41 +43,20 @@ or
4243
git clone https://github.com/<username>/wiki.git
4344
```
4445

45-
3. Prepare your python virtual environment and dependencies
46+
3. Navigate into wiki repository folder
4647

4748
```sh
48-
# Navigate to the cloned repo
4949
cd wiki/
50-
51-
# Create a python3 virtual environment in your cloned repository
52-
python -m venv venv
53-
54-
# Activate the virtual environment
55-
source venv/bin/activate
5650
```
5751

58-
4. Install needed python dependencies using python package manager -> pip
52+
4. Choose one of the two deployment methods below.
5953

60-
```sh
61-
pip install -r requirements.txt
62-
```
54+
... DEPLOYMENT / STARTUP of mkdocs ...
6355

64-
5. At this point, load up the clone repository in a text editor that has live-markdown preview function.
56+
5. At this point, load up the cloned repository in a text editor that has live-markdown preview function.
6557
- For example: Visual Studio Code. Instructions: (https://code.visualstudio.com/Docs/languages/markdown)
6658

67-
6. When you are done, use the following steps to build & preview the documentation / changes locally.
68-
69-
Build the documentation
70-
```sh
71-
make build --strict
72-
```
73-
74-
Serve the documentation
75-
```sh
76-
make serve --strict
77-
```
78-
79-
7. Once you are happy and the added changes are looking proper, you are ready to submit your work.
59+
6. Once you are happy and the added changes are looking proper, you are ready to submit your work.
8060

8161
Add modified files for commiting
8262
```sh
@@ -100,3 +80,44 @@ git push
10080
```
10181

10282
8. Send a Pull Request :)
83+
84+
## Deployment / Usage of mkdocs
85+
86+
### Native deployment
87+
88+
1. Create & activate python virtual-environment (might need dependency `python3-venv`, see: <https://docs.python.org/3/library/venv.html>)
89+
90+
```
91+
python3 -m venv venv
92+
source venv/bin/activate
93+
```
94+
95+
2. Install mkdocs and dependencies
96+
97+
```
98+
pip install -r requirements.txt
99+
```
100+
101+
3. Edit docs and verify with the following commands:
102+
103+
Serve the documentation (<http://127.0.0.1:8000>)
104+
```
105+
mkdocs serve --strict
106+
```
107+
108+
Build the documentation
109+
```
110+
mkdocs build --strict
111+
```
112+
113+
### Docker deployment
114+
115+
1. Execute docker container:
116+
117+
```
118+
docker compose up
119+
```
120+
121+
2. Navigate to <http://127.0.0.1:8000>
122+
3. Make your changes and verify the formatting / linking still checks out.
123+

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3"
2+
3+
services:
4+
wiki:
5+
build:
6+
context: .
7+
ports:
8+
- "127.0.0.1:8000:8000"
9+
volumes:
10+
- ./:/wiki

0 commit comments

Comments
 (0)