• 1 Post
  • 53 Comments
Joined 2 years ago
cake
Cake day: June 26th, 2023

help-circle


  • Install Virtualbox (or some software to handle virtual machines).
    Install Debian (or some other OS of your choice, I won’t judge if you prefer Windows).
    Update your OS (apt update && apt upgrade -y on Debian).
    Take a snapshot of your VM’s current state after updating. Saves a lot of time if you mess up or want a clean slate.

    Now you decide on what you want. Do you want to install n8n or Node-RED for automation? Do you want to use Immich for pictures? Paperless to save papers in a digital format? Audiobookshelf to listen on your books or podcasts? Jellyfin to stream your media? Set up a Minecraft or Factorio server?

    Once you have decided on what you want to do, try to do it in your virtual machine.
    Once you understand how to set it up and configure it to your liking, decide on how you want to host it. I took an office computer, added a few HDDs and replaced the case with a bigger one and it’s now my home server, but any old laptop will do. Just make sure to take backups.

    I used to have a Dell R710 and a virtual machine for each service I hosted, but I have moved to docker because it as simple as taking the often provided compose file, tweaking it a bit (where to store data etc) and running it with docker compose up -d.










  • Here is two enteries from my Caddyfile:

    ip.domain.tld:80 {
            respond "{client_ip}" 200
    }
    
    
    git.domain.tld {
            reverse_proxy forgejo:3000
    }
    

    This is all I need and Caddy will handle the rest. I have created a network with podman/docker that I add to any container that I need to reverse proxy to.









  • Is it considered best practice to run a bunch of different compose files, and update them all separately?

    tl;dr I do one compose file per application/folder because I found that to suite me best.

    I knew about docker and what is was for a long time, but just recently started to use it (past year or so) so I’m no expert . Before docker, I had one VM for each application I wanted and if I messed something up (installed something and it broke or something), I just removed the entier VM and made a new one. This also comes with the problem that every VM needs to be stopped before the host can be shutdown, and startup took more work to ensure that it worked correctly.

    Here is a sample of my layout:

    .
    ├──audiobookshelf
    │  ├──config
    ├──diun
    │  └───data
    ├──jellyfin
    ├──kuma
    ├──mealie
    │  ├──data
    │  └──pgdata
    ├──n8n
    │  ├──n8n_data
    │  └──n8n_files
    ├──paperless
    │  ├──consume
    │  └──export
    ├──syncthing
    │  └──data
    └───tasksmd
        └──config
    

    I considered using one compose file and put everything in it by opted to instead use one file for each project. Using one compose file for everything would make it difficult to stop just one application. And by having it split into separate folders, I can just remove everything in it if I mess up and start a new container.

    As for updating, I made script that pulls everything:

    #!/bin/bash
    
    function docker_update {
        cd $1
        docker compose down && docker compose pull && docker compose up -d
    }
    docker_update "/path/to/app1"
    docker_update "/path/to/app2"
    docker_update "/path/to/app3"
    

    Here is a small sample from my n8n compose file (not complete file):

    services:
      db:
        container_name: n8n-db
        image: postgres
        ...
        networks:
          - n8n-network
    
      adminer:
        container_name: n8n-db-adminer
        image: adminer
        restart: unless-stopped
        ports:
          - 8372:8080
        networks:
          - shared-network
          - n8n-network
    
      n8n:
        container_name: n8n
        networks:
          - n8n-network
          - shared-network
        depends_on:
          db:
            condition: service_healthy
    
    volumes:
      db_data:
    
    networks:
      n8n-network:
      shared-network:
        external: true
    

    shared-network is shared between Caddy and any containter I need to access to externally (reverse proxy) and then one network that is shared between the applications.