Hi @AGordiGuerrero , I'll try to answer your questions the best I can ...
1) I see no special difficulty in running docker inside a VM, especially if this VM is running debian 8 which is fully supported. Just check that your VM meets the recommended requirements .
2) There's no need to backup the whole system. Simply backup the databases (postgreSQL & elasticsearch ) and the files located in public/uploads (eg. using tar cvzf public.tar.gz public/uploads).
3) test/dev and production modes are…
says all you need to backup is « public/uploads ». i’m guessing it is not any more. « .gitignore » includes several directories, such as « invoices », and « proof_of_identity_files ».
if my guess is correct, that means a release might add new directories that you should backup. am I correct?
Your guess is correct!
I would say you have to backup every volumes listed in the docker-compose file , excepted public/packs
(which are generated), log
(unless you want it) and plugin
(unless you have some plugins).
just hacked up a script to backup files. should work on any platforms.
#!/usr/bin/env ruby
require "yaml"
require "open3"
require "shellwords"
require "date"
require "pathname"
fab_root_dir = Pathname.new(ARGV.first || Dir.pwd)
docker_compose_file = fab_root_dir / "setup" / "docker-compose.yml"
config = YAML.load(File.read(docker_compose_file))
target_directories = config["services"]["fabmanager"]["volumes"].map { |s| s.split(":").first.gsub(/\${PWD}\//, "") }
# do not backup generated files
target_directories.reject! { |s| s == "public/packs" }
timestamp = DateTime.now.iso8601
backup_dir = fab_root_dir / "backup"
backup_filename = backup_dir / format("backup-%s.tgz", timestamp)
backup_command = format("tar -cvzf %s -C %s %s",
backup_filename.to_s.shellescape,
fab_root_dir.to_s.shellescape,
target_directories.map { |d| d.shellescape }.join(" ")
)
Dir.mkdir(backup_dir.to_s) unless Dir.exists?(backup_dir.to_s)
target_directories.each do |d|
full_path = fab_root_dir / d
Dir.mkdir(full_path.to_s) unless Dir.exists?(full_path.to_s)
end
stdout, stderr, status = Open3.capture3(backup_command)
puts "STDOUT"
puts stdout
puts "STDERR"
puts stderr
puts format("Exit status: %d", status.to_i)
exit status.to_i
1 « J'aime »