New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Deployment #2
Comments
I actually tested postgres backup workflow using docker. All you need is the pgdump tool which is basically just a postgres client. You can definitely have it without a whole PG install, see this thread for more : https://dba.stackexchange.com/questions/193023/pg-dump-without-postgresql I plan to add configuration option where you would be able to give the path to pg_dump tool. With this new way you'd be able to bind directly pg_dump from postgres container using volumes. |
@laportem release 0.5.1 is out with pg_dump path override. You can now add to // config/plugins.js
module.exports = () => ({
//...
"backup-restore": {
postgres: {
// Update with your path
pathToPgDump: "/usr/local/opt/libpq/bin/pg_dump",
},
},
}); If you want to keep your strapi image as it is now, you could bind pg_dump from postgres container. See https://phoenixnap.com/kb/how-to-share-data-between-docker-containers for more. Basically it's just about binding the tool to a path in strapi container and then use this path in strapi config. |
thanks, will give it a try and feedback if issues |
Got the backup to work ok. i see on your TODO list, restore is still in the pipeline. Until then can you advise on a restore progress |
Could you guide on the same for restoring from dump for docker setup? |
Sorry for late reply, I have actually no ETA for this. If anyone wants to submit a PR feel free to do it!
# copy backup in your db container
docker cp my_data.dump postgres_container:/backups
docker exec postgres_container pg_restore -U postgres -d some_database /backups/my_data.dump More here: The same could be achieved for mysql, you just need to update exec command : docker cp backup.sql postgres_container:/backups
docker exec postgres_container mysql -u [user] -p [database_name] < /backups/backup.sql More: https://phoenixnap.com/kb/how-to-backup-restore-a-mysql-database |
This assumes that Postgres is physically installed on the machine. But what if I have both Strapi and Postgres running in docker containers. How do I get the plugin to see pg_dump
The text was updated successfully, but these errors were encountered: