Comment on Those who are hosting on bare metal: What is stopping you from using Containers or VM's? What are you self hosting?

<- View Parent
slazer2au@lemmy.world ⁨1⁩ ⁨day⁩ ago

For ease of moving containers between hosts I would use a docker-compose.yaml to set how you want storage shared, what ports to present to the host, what environment variables your application wants. Using Wordpress as an example this would be your starting point
github.com/docker/awesome-compose/…/compose.yaml

all the settings for the database is listed under the db heading. You would have your actual database files stored in /home/user/Wordpress/db_data and you would link /home/user/Wordpress/db_data to /var/lib/MySQL inside the container with the line

volumes:
      - db_data:/var/lib/mysql  

As the compose file will also be in home/user/Wordpress/ you can drop the common path.

That way if you wanted to change hosts just copy the /home/user/Wordpress folder to the new server and run docker compose up -d and boom, your server is up. No need to faf about.

Containers by design are suppose to be temporary and the runtime data is recreated each time the container is launched. The persistent data is all you should care for.

source
Sort:hotnewtop