In local environment, I am using docker-compose file to create multiple containers, including mysql container.
The data of mysql container is stored in ./db-data.
There are 4 tables in the database, e.g. Table A,B,C,D.
In Development environment, I've created an ec2 instance and used same docker-compose file to create containers, while the mysql database is managed be Aws RDS.
I want to copy all the data of Table A and B from local to development environment, but I wonder how can I achieve this?
docker-compose.yml
version: '2.1'
services:
test-db:
image: mysql:5.7
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_USER=admin
- MYSQL_PASSWORD=12345
- MYSQL_DATABASE=test
volumes:
- ./db-data:/var/lib/mysql
ports:
- 3306:3306
test-web:
environment:
- NODE_ENV=local
#- DEBUG=*
- PORT=3030
build: .
command: >
./wait-for-db-redis.sh test-db npm run dev
ports:
- "3030:3030"
depends_on:
- test-db
