0

I want to be able to develop the same website from different computers. I've created github repository and Docker enviroment (using this tutorial: https://www.vultr.com/docs/deploy-a-php-application-using-docker-compose ).

I've got the git repository on both workstations to share the project and Docker files. I've built images ("docker build -t vultr-php php/"; "docker build -t vultr-nginx nginx/") and run composer file ("docker-compose up -d") on both computers. I'm new to Docker so I've only followed this vultr.com tutorial.

Enviroment is working but I'd like to share the database in a way that when I'm done working on a laptop and start working on a desktop then I've got the same database. Is there a way to do this with docker/git?

piiwko
  • 1
  • in the same way the the tutorial exposed port 80 of the web server you need to expose port 3306 into your LAN. – danblack Feb 18 '20 at 08:21
  • Wouldn't I still have two separate databases on each computer? What I meant was to somehow synchronize databases to have the same records on both. – piiwko Feb 18 '20 at 15:50
  • Apologies I misread the question. After shutting mysql down on one system. copy the dbdata volume (including aspect of [this answer](https://stackoverflow.com/questions/21597463/how-to-port-data-only-volumes-from-one-host-to-another#23778599))to the other computer before the docker container is started there. If its large to copy, let us know and we'll suggest something else. – danblack Feb 18 '20 at 21:00

0 Answers0