Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computer_science:docker:docker_dokuwiki_portable [2020/07/24 13:54] – carlossousa | computer_science:docker:docker_dokuwiki_portable [2023/12/01 12:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
This documentation was also used successfully to deploy to a VPS. | This documentation was also used successfully to deploy to a VPS. | ||
+ | |||
+ | I will be using a pre-made image from [[https:// | ||
I'm assuming you already have Docker and Docker-Compose installed. | I'm assuming you already have Docker and Docker-Compose installed. | ||
Line 17: | Line 19: | ||
<code bash> | <code bash> | ||
sudo apt install docker -y && sudo apt install docker-compose -y | sudo apt install docker -y && sudo apt install docker-compose -y | ||
+ | |||
</ | </ | ||
- | First, after installing Ubuntu, we should expand the LVM to use the entire | + | ---- |
+ | |||
+ | ===== Preparations due to LVM ===== | ||
+ | |||
+ | First, after installing Ubuntu, we should expand the LVM to use the entire | ||
<code bash> | <code bash> | ||
Line 53: | Line 60: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== Avoiding "sudo docker command" | ||
Let's add ourselfs to the Docker Group so we don't have to prefix every Docker command with ' | Let's add ourselfs to the Docker Group so we don't have to prefix every Docker command with ' | ||
Line 61: | Line 73: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Creating the Volumes for Data ===== | ||
Now we need to create the docker volumes, which points to a local folder, so we can manipulate / migrate / backup the data easily if needed. | Now we need to create the docker volumes, which points to a local folder, so we can manipulate / migrate / backup the data easily if needed. | ||
Line 84: | Line 100: | ||
</ | </ | ||
- | We can either create all volumes and directories necessary manually, or use this script to create the folders and volumes in one go: | + | We can either create all volumes and directories necessary manually, or use this script |
<code bash> | <code bash> | ||
Line 99: | Line 115: | ||
</ | </ | ||
- | After that we can create our docker-compose.yml which will be used to manage our container: | + | ---- |
+ | |||
+ | ===== Creating the docker-compose.yml file ===== | ||
+ | |||
+ | After that we can create our **docker-compose.yml** | ||
<code bash> | <code bash> | ||
Line 131: | Line 151: | ||
</ | </ | ||
+ | ---- | ||
+ | ===== Starting the Container ===== | ||
+ | |||
+ | Finally, if you already have Data from your previous DokuWiki, you can just copy/paste them in those previous created folders. Else you will just start a new DokuWiki once you start up the container. A few usefull commands to manage the container with docker-compose | ||
+ | |||
+ | ^Command^Purpose| | ||
+ | |docker-compose up -d|Starts the Container and dettach (so you have your bash prompt back)| | ||
+ | |docker-compose down|Stops the Container| | ||
+ | |docker-compose ps|Checks the status of the Container| | ||
+ | |||
+ | Your container should now be accessible via [[http://< | ||
+ | |||
+ | Do note that https:// isn't available, since the container isn't listening on port 443. // | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Backing Up / Migrating the Data ===== | ||
+ | |||
+ | We can easily migrate the data by grabbing everything in the mounted volumes and collecting them into a tar(ball). | ||
+ | |||
+ | To do that we can create a file called **backtup_to_tar.sh** which when run will grab everything from // | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | SOURCE_PATH="/ | ||
+ | BACKUP_PATH="/ | ||
+ | BACKUP_NAME=" | ||
+ | tar cvf " | ||
+ | |||
+ | |||
+ | </ | ||