Bumping - anyone with any thoughts?
Syncing my database between dev and staging in Docker setup?
Hi all,
I'm building my app locally locally using Docker containers for all my moving parts - npm, composer, nginx, mysql etc.
My database directory is /mysql and my database name is laravel so I have a folder /mysql/laravel - is it possible for me to make this a GIT repository and pull it onto staging, thereby keeping all my data sync'd between my dev environment and staging?
I've tried ssh'ing into my AWS EC2 instance, renaming /mysql/laravel to /mysql/laravel_bu and then creating a new folder for the laravel db, initialising a new GIT repository, adding my remote and pulling down the files from bitbucket, but it hasn't worked - somehow it still seems to use the data from my previous database which seems odd.
My local dev environment is Mac and my staging site is on an Amazon EC2 instance.
Thanks in advance for any help!
OK... I've had a word with myself and changed my approach on this - I've just added phpmyadmin to my docker-compose.yml
phpmyadmin:
image: phpmyadmin
environment:
PMA_HOST: mysql
PMA_PASSWORD: secret
PMA_ARBITRARY: 1
restart: always
ports:
- 8081:80
depends_on:
- mysql
And opened up port 8081 on my EC2 instance - all works fine and allows me to import/export the database between dev and staging. Probably a way better solution than my orginal idea
Please or to participate in this conversation.