keep more space in dev docker by not using dockerfile for mariadb containers

This commit is contained in:
maxpozdeev 2022-11-12 16:35:13 +03:00
parent 86c02990c1
commit 9e4b8776d7
16 changed files with 79 additions and 34 deletions

View file

@ -1 +1,5 @@
*/db_data
*/db_data
mtt-php56-apache
mtt-php71-apache
mtt-php72-apache-mariadb055
_mariadb055

View file

@ -0,0 +1,4 @@
[mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
innodb_log_file_size=10M

View file

@ -1,4 +0,0 @@
FROM mariadb:10.5
COPY my.cnf /etc/mysql/conf.d/

View file

@ -1,3 +0,0 @@
FROM mariadb:10.8
COPY my.cnf /etc/mysql/conf.d/

View file

@ -0,0 +1 @@
PLATFORM_NAME=mtt-dev-php72-apache-mariadb100

View file

@ -0,0 +1,47 @@
version: "3.9"
networks:
network:
name: "${PLATFORM_NAME}-network"
services:
web:
build:
context: ../mtt-php72-apache/
dockerfile: Dockerfile-web
image: mtt-dev/php:7.2-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
environment:
- MTT_ENABLE_DEBUG=YES
- MTT_DB_TYPE=mysql
- MTT_DB_HOST=db
- MTT_DB_NAME=mytinytodo
- MTT_DB_USER=mtt
- MTT_DB_PASSWORD=mtt
- MTT_DB_PREFIX=mtt_
- MTT_DB_DRIVER=mysqli
volumes:
- ../../../src:/var/www/html
- ../mtt-php72-apache/php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
- ../mtt-php72-apache/php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
depends_on:
- db
networks:
- network
db:
image: mariadb:10.0.15
container_name: ${PLATFORM_NAME}-db
#restart: always
environment:
MYSQL_ROOT_PASSWORD: JustForDev
MYSQL_USER: mtt
MYSQL_PASSWORD: mtt
MYSQL_DATABASE: mytinytodo
volumes:
- ../_mariadb100/my.cnf:/etc/mysql/conf.d/my.cnf
- ../_mariadb100/db_data:/var/lib/mysql
networks:
- network

View file

@ -9,7 +9,7 @@ services:
build:
context: ../mtt-php72-apache/
dockerfile: Dockerfile-web
image: mytinytodo-dev:php7.2-apache
image: mtt-dev/php:7.2-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
@ -32,10 +32,7 @@ services:
- network
db:
build:
context: ../_mariadb105
dockerfile: Dockerfile-db
image: mytinytodo-dev:mariadb10.5
image: mariadb:10.5
container_name: ${PLATFORM_NAME}-db
#restart: always
environment:
@ -44,6 +41,7 @@ services:
MARIADB_PASSWORD: mtt
MARIADB_DATABASE: mytinytodo
volumes:
- ../_mariadb105/my.cnf:/etc/mysql/conf.d/my.cnf
- ../_mariadb105/db_data:/var/lib/mysql
networks:
- network

View file

@ -3,7 +3,7 @@ services:
build:
context: .
dockerfile: Dockerfile-web
image: mytinytodo-dev:php7.2-apache
image: mtt-dev/php:7.2-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"

View file

@ -3,7 +3,7 @@ services:
build:
context: .
dockerfile: Dockerfile-web
image: mytinytodo-dev:php7.4-apache
image: mtt-dev/php:7.4-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"

View file

@ -9,7 +9,7 @@ services:
build:
context: ../_nginx
dockerfile: Dockerfile-nginx
image: mytinytodo-dev:nginx
image: mtt-dev/nginx
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
@ -24,7 +24,7 @@ services:
build:
context: .
dockerfile: Dockerfile-fpm
image: mytinytodo-dev:php7.4-fpm
image: mtt-dev/php:7.4-fpm
container_name: ${PLATFORM_NAME}-fpm
hostname: php-fpm
environment:

View file

@ -9,7 +9,7 @@ services:
build:
context: ../mtt-php80-apache/
dockerfile: Dockerfile-web
image: mytinytodo-dev:php8.0-apache
image: mtt-dev/php:8.0-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
@ -30,10 +30,7 @@ services:
- network
db:
build:
context: ../_mariadb105
dockerfile: Dockerfile-db
image: mytinytodo-dev:mariadb10.5
image: mariadb:10.5
container_name: ${PLATFORM_NAME}-db
#restart: always
environment:
@ -42,6 +39,7 @@ services:
MARIADB_PASSWORD: mtt
MARIADB_DATABASE: mytinytodo
volumes:
- ../_mariadb105/my.cnf:/etc/mysql/conf.d/my.cnf
- ../_mariadb105/db_data:/var/lib/mysql
networks:
- network

View file

@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile-web
image: mytinytodo-dev:php8.0-apache
image: mtt-dev/php:8.0-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"

View file

@ -9,7 +9,7 @@ services:
build:
context: ../mtt-php81-apache/
dockerfile: Dockerfile-web
image: mytinytodo-dev:php8.1-apache
image: mtt-dev/php:8.1-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
@ -31,25 +31,25 @@ services:
- network
db:
build:
context: ../_mariadb108
dockerfile: Dockerfile-db
image: mytinytodo-dev:mariadb10.8
image: mariadb:10.8
container_name: ${PLATFORM_NAME}-db
restart: always
#restart: always
environment:
MARIADB_ROOT_PASSWORD: JustForDev
MARIADB_USER: mtt
MARIADB_PASSWORD: mtt
MARIADB_DATABASE: mytinytodo
volumes:
- ../_mariadb108/my.cnf:/etc/mysql/conf.d/my.cnf
- ../_mariadb108/db_data:/var/lib/mysql
networks:
- network
adminer:
image: adminer
image: adminer:latest
container_name: ${PLATFORM_NAME}-adminer
environment:
ADMINER_DEFAULT_SERVER: db
ports:
- 8079:8080
networks:

View file

@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile-web
image: mytinytodo-dev:php8.1-apache
image: mtt-dev/php:8.1-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"

View file

@ -9,7 +9,7 @@ services:
build:
context: ../_nginx
dockerfile: Dockerfile-nginx
image: mytinytodo-dev:nginx
image: mtt-dev/nginx
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"
@ -24,7 +24,7 @@ services:
build:
context: .
dockerfile: Dockerfile-fpm
image: mytinytodo-dev:php8.1-fpm
image: mtt-dev/php:8.1-fpm
container_name: ${PLATFORM_NAME}-fpm
hostname: php-fpm
environment:

View file

@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile-web
image: mytinytodo-dev:php8.2-apache
image: mtt-dev/php:8.2-apache
container_name: ${PLATFORM_NAME}-web
ports:
- "8080:80"