This commit introduces a MySQL container and an Adminer container to the docker-compose.yml file. The dependencies list was also updated, swapping the 'app' and 'db' listings to ensure the correct start-up order. An additional MySQL configuration file was added to mitigate heavy CPU usage. A new .gitignore file is also introduced to avoid unintended inclusion of database files in version control.
This commit is contained in:
		@@ -9,8 +9,9 @@ services:
 | 
			
		||||
            - ${DOCKER_ANGIE_PORT}:80
 | 
			
		||||
        #restart: always
 | 
			
		||||
        depends_on:
 | 
			
		||||
            - app
 | 
			
		||||
            - db
 | 
			
		||||
            - redis
 | 
			
		||||
            - app
 | 
			
		||||
    app:
 | 
			
		||||
        image: service-captcha-laravel
 | 
			
		||||
        container_name: service-captcha-laravel-www
 | 
			
		||||
@@ -25,3 +26,22 @@ services:
 | 
			
		||||
            - "9000"
 | 
			
		||||
    redis:
 | 
			
		||||
        image: redis:3.0-alpine
 | 
			
		||||
    db:
 | 
			
		||||
        image: mysql:8.0.33
 | 
			
		||||
        command: --default-authentication-plugin=mysql_native_password
 | 
			
		||||
        #restart: always
 | 
			
		||||
        ports:
 | 
			
		||||
            - ${DOCKER_DB_PORT}:3306
 | 
			
		||||
        environment:
 | 
			
		||||
            MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
 | 
			
		||||
            MYSQL_DATABASE: ${DB_DATABASE}
 | 
			
		||||
            MYSQL_USER: ${DB_USERNAME}
 | 
			
		||||
            MYSQL_PASSWORD: ${DB_PASSWORD}
 | 
			
		||||
        volumes:
 | 
			
		||||
            - ./docker/dev/db:/var/lib/mysql
 | 
			
		||||
            - ./docker/dev/my.cnf:/etc/mysql/conf.d/my.cnf
 | 
			
		||||
    adminer:
 | 
			
		||||
        image: adminer
 | 
			
		||||
        #restart: always
 | 
			
		||||
        ports:
 | 
			
		||||
            - ${DOCKER_ADMINER_PORT}:8080
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								docker/dev/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								docker/dev/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
db/*
 | 
			
		||||
!db/.gitignore
 | 
			
		||||
							
								
								
									
										9
									
								
								docker/dev/my.cnf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								docker/dev/my.cnf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
[mysqld]
 | 
			
		||||
innodb_lru_scan_depth=100  # from 1024 to conserve 90% CPU cycles used for function
 | 
			
		||||
innodb_io_capacity=1900  # from 200 to allow more IOPSecond to your storage device
 | 
			
		||||
innodb_flush_neighbors=2  # from 0 to expedite writing to current extent
 | 
			
		||||
innodb_max_dirty_pages_pct_lwm=1  # from 10 percent to expedite writes
 | 
			
		||||
innodb_max_dirty_pages_pct=1  # from 90 percent to reduce innodb_buffer_pool_pages_dirty count
 | 
			
		||||
innodb_change_buffer_max_size=50  # from 25 percent to expedite your high volume activity
 | 
			
		||||
innodb_flush_log_at_trx_commit=0
 | 
			
		||||
skip_log_bin=1
 | 
			
		||||
		Reference in New Issue
	
	Block a user