Difference between revisions of "Bringing up a TWiki Docker Instance"
PeterHarding (talk | contribs) (Created page with "I am in the process of recovering a TWiki installation for a client. I have been given a tar archive containing the /data and /pub for the organizations internal TWiki data. I want to bring it up as a Docker instance with an NGINX reverse proxy exposing it to the outside world via HTTPS. = Approach One = Use an existing Docker TWiki. I found a number of possible solution of various vintages. * https://github.com/mharrend/docker-twiki * https://hub.docker.com/r/open...") |
PeterHarding (talk | contribs) |
||
| Line 70: | Line 70: | ||
</pre> | </pre> | ||
[[File: TWiki_Site_Map.jpg]] | |||
However, this content is password protected. | |||
<pre> | <pre> | ||
Revision as of 15:45, 28 January 2026
I am in the process of recovering a TWiki installation for a client. I have been given a tar archive containing the /data and /pub for the organizations internal TWiki data. I want to bring it up as a Docker instance with an NGINX reverse proxy exposing it to the outside world via HTTPS.
Approach One
Use an existing Docker TWiki.
I found a number of possible solution of various vintages.
- https://github.com/mharrend/docker-twiki
- https://hub.docker.com/r/opensciencegrid/docker-twiki-converter/
After some investigation I settled on -
I got it working initially using HTTP on a PC running docker locally to understand how the pieces fitted together.
I then moved it across to a Linux server where I could front it with an NGINX revers proxy.
Here are the basic stages:
1. Get the Docker Container Running
This was achieved using a simple shell script as follows:
#!/bin/sh docker run -dt -p 8219:80 -v ./wiki/:/wiki -e URL_HOST=http://127.0.0.1:8219/ -e ADMIN_PW=Secret --name twiki --rm heradon/twiki
In this case the NGINX proxy is redirecting to http://127.0.0.1:8219 - thus the ports used above.
The local ./wiki directory contains pub and data directories from the old TWiki site each of which contain a CFP directory with the custom wiki data
Once I had the container running I could see the Main, TWiki and Sandbox default TWiki content.
2. Retrofit the CFP Data
The underlying TWiki Docker installation lives in /var/www/twiki. This folder conatains (among others) a 'pub' and 'data' folder which contain the default TWiki contents. As part of the Docker container initialization the run script moves twiki/data and twiki/pub to /data/data and /data/pub and then sym-links these back into /var/www/twiki.
This process collided with my initial Docker setup which mapped a local ./data to /data in the container - and this broke the internal container application setup as the run script directory re-work failed. As a result I mounted the client CFP data in ./wiki and once the container was up an running I copied it across to combine the custom site data with the generic TWiki data.
Once I had this worked out I was able to connect to the container and put the custom content in place:
$ docker exec -it twiki bash % cd /data/pub % cp -r /wiki/pub/CFP . % cd /data/data % cp -r /wiki/data/CFP .
And so the data was now in place:
root@5db33ad05760:/data# ls -l data total 116 drwxrwxr-x 2 www-data www-data 4096 Jan 28 04:02 CFP drwxrwxr-x 2 www-data www-data 4096 Jul 16 2018 Main drwxrwxr-x 2 www-data www-data 4096 Jul 16 2018 Sandbox drwxrwxr-x 2 www-data www-data 73728 Jul 16 2018 TWiki drwxrwxr-x 2 www-data www-data 4096 Jul 16 2018 Trash drwxrwxr-x 2 www-data www-data 4096 Jul 16 2018 _default drwxrwxr-x 2 www-data www-data 4096 Jul 16 2018 _empty -rwxrwxr-x 1 www-data www-data 337 Jan 28 04:06 log202601.txt -rwxrwxr-x 1 www-data www-data 9024 Jul 16 2018 mime.types
However, this content is password protected.
