0

I had a docker compose instance running on a raspberry pi, unfortunately the SD card got corrupted and I'm not able to boot the system.

However managed to recover all the volumes directories from the SD card.

Now I'm at the point of re-creating the docker compose stack on a new host and I'd like to know if it's possible to make the new containers pointing to the recovered data

gabric
  • 1,865
  • 2
  • 21
  • 32

1 Answers1

1

If you're doing it through docker-compose.yml config file, you just need to create a volume with mount point on recovered data (some folder), and add this volume to docker container which you are creating.

services:
   wordpress:
    image: wordpress:latest
    volumes:
      - wp_data:/var/www/html
    ports:
      - 8084:8084
    restart: always
    environment:
      - WORDPRESS_DB_HOST=172.18.0.13
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=testpass
      - WORDPRESS_DB_NAME=wordpress
volumes:
  db_data:
  wp_data:

At the end of the file, you just give the name of the volume that you created.

Andrew
  • 23
  • 4