Related pages: 🇫🇷 Utiliser Docker
1. Run Pwic.wiki in Docker
Docker is a tool that allows you to run independent Pwic.wiki instances without setuping several virtual machines.
1.1. Install Docker
Of course, you need at least one host server!
The procedure for Debian is explained on the official website.
1.2. Prepare Pwic.wiki
You have cloned Pwic.wiki's repository in a blank folder:
git clone https://github.com/gitbra/pwic.git .
In the files pwic.py
and pwic_admin.py
, remove the following code lines:
# Check root
try:
if os.geteuid() == 0:
print('Error: Pwic.wiki should not be started with the root account')
return False
except AttributeError:
pass # No check on Windows
Indeed, this check is no more valid by the effect of the sandbox.
1.3. Prepare your image
Create a new file Dockerfile
:
FROM python:3
COPY LICENSE pwic*.py README.md requirements.txt /pwic/
COPY static/ /pwic/static/
COPY templates/ /pwic/templates/
WORKDIR /pwic
RUN pip install --upgrade -r requirements.txt
RUN python3 pwic_admin.py init-db
EXPOSE 8080
CMD python3 pwic.py --host 127.0.0.1 --port 8080
Open a console as root and build your image:
docker build . -t pwic-docker
1.4. Run your image
Explore your image in a console:
docker run -it pwic-docker sh
Run your image:
docker run -p 8080:8080 pwic-docker
Open your web browser at http://127.0.0.1:8080 by default. You should see something like this:
1.5. Customize your image
The steps are identical to the ones of classical setup.
2. Disclaimer
We don't support actively Pwic.wiki in Docker. Therefore this article is not fully complete.
However, it is a good start thinking on a proper configuration at your end.
Attached documents
Revision #1 was last modified by gitbra
on 2023-12-11 at 00:00:00 — bc68c9b9168a4cde