Running a staging server using docker-componse.yml
configuration, which has a MySQL service running with the following configuration
services:
database:
image: mysql:8.0.17
container_name: qcg__staging__database
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- qcg7_staging_db:/var/lib/mysql
environment:
- MYSQL_DATABASE=app_staging
- MYSQL_USER=app_staging
- MYSQL_PASSWORD=app_staging
- MYSQL_ROOT_PASSWORD=app_staging
ports:
- 3306:3306
volumes:
qcg7_staging_db:
Every time a code is pushed to the staging server, the docker containers are stopped and restarted using the following command
docker-compose down --remove-orphans
docker-compose -f docker-compose-staging.yml up --build -d
After few days of usages, the volume usages of the database reach 40GB which the actual data size in the database is 2.3 GiB
# docker system df -v
Local Volumes space usage:
VOLUME NAME LINKS SIZE
qcg-backend_qcg7_staging_db 1 20.06GB
The output of Workbench database inspect