Docker Consolidation Project, Part Three

Docker Consolidation Project, Part Three
Photo by Mohammad Rahmani / Unsplash

Migrate Homebox

There is a nice export function in the Homebox application, so I create an export which should be simple to import once again.

Install Homebox on DOCKER-01

Steps taken from DOCKER-01

  • sudo mkdir /apps/Homebox-Inventory
  • cd /apps/Homebox-Inventory
  • sudo nano docker-compose.yml
version: "3.4"

services:
  homebox:
    image: ghcr.io/hay-kot/homebox:latest
    container_name: homebox
    restart: always
    environment:
    - HBOX_LOG_LEVEL=info
    - HBOX_LOG_FORMAT=text
    - HBOX_WEB_MAX_UPLOAD_SIZE=10
    volumes:
      - homebox-data:/data/
    ports:
      - 3100:7745

volumes:
  homebox-data:
    driver: local
  • I save the file docker-compose.yml
  • sudo docker-compose pull
    • Pulling homebox ... done
  • sudo docker-compose up -d

Migrate Homebox Data

I can bring Homebox up on DOCKER-01 and create a login. Then I can import my saved data which goes through without a hitch. Super easy!

Decommission HOMEBOX-01

Steps performed on HOMEBOX-01

  • sudo shutdown now

Steps performed on HV-03 via Windows Admin Center

  • I navigate to Virtual Machines
  • I select HOMEBOX-01
  • I click on Manage then Delete
  • I choose the option Delete all virtual disks

Steps taken from DC-02 via Windows Admin Center

  • I navigate to DNS
  • I click on domain.local
  • I select HOMEBOX.domain.local and click Delete

Steps taken from desktop

  • I delete the HOMEBOX-01 SSH keys
  • I remove HOMEBOX-01 from Windows Terminal's JSON file

Migrate Tandoor Recipes

Install Tandoor Recipes on DOCKER-01**

Steps performed on DOCKER-01

  • sudo mkdir /apps/Tandoor-Recipes
  • cd /apps/Tandoor-Recipes
  • sudo nano docker-compose.yml
version: "3"
services:
  db_recipes:
    restart: always
    image: postgres:15-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env

  web_recipes:
    restart: always
    image: vabene1111/recipes
    env_file:
      - ./.env
    volumes:
      - staticfiles:/opt/recipes/staticfiles
      # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
      - nginx_config:/opt/recipes/nginx/conf.d
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes

  nginx_recipes:
    image: nginx:mainline-alpine
    restart: always
    ports:
      - 8017:80
    env_file:
      - ./.env
    depends_on:
      - web_recipes
    volumes:
      # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
      - nginx_config:/etc/nginx/conf.d:ro
      - staticfiles:/static:ro
      - ./mediafiles:/media:ro

volumes:
  nginx_config:
  staticfiles:
  • I save the docker-compose.yml file
  • wget https:rawgithubusercontent.com/vabene1111/recipes/develop/.env.template -O .env
  • sudo nano .env
    • I set SECRET_KEY=
    • I set TIMEZONE=America/Detroit
    • I set POSTGRES_PASSWORD=
    • I set EMAIL_HOST=
    • I set EMAIL_PORT=
    • I set EMAIL_HOST_USER=
    • I set Email_HOST_PASSWORD=
    • I set DEFAULT_FROM_EMAIL=
  • I save the file .env
  • sudo docker-compose pull
  • sudo docker-compose up -d

Migrate Tandoor Recipe Data

I utilize the built in export option in Tandoor on TANDOOR-01 and I am able to successfully import it on DOCKER-01.

Decommission TANDOOR-01

Steps performed on TANDOOR-01

  • sudo shutdown now

Steps performed on HV-03 via Windows Admin Center

  • I navigate to Virtual Machines
  • I select TANDOOR-01
  • I click on Manage then Delete
  • I choose the option Delete all virtual disks

Steps performed on DC-02 via Windows Admin Center

  • I go to DNS
  • I click on domain.local
  • I select TANDOOR.domain.local and click EDIT
  • I change the IP Address to DOCKER-01's address

Steps taken on desktop

  • I delete the TANDOOR-01 SSH keys
  • I remove TANDOOR-01 from Windows Terminal's JSON file