From 5c425e68d67de85c9b33bd6d8f7d25c707fd3639 Mon Sep 17 00:00:00 2001 From: Daniel Mohns Date: Wed, 24 Jan 2024 14:17:11 +0100 Subject: [PATCH] Small Docker compose file improvements (#24) * Make the compose file more lean * Use Docker Volumes for data storage --- docker-compose.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 23f1c7fb6..f1934359d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ -version: "3.1" +version: "3" services: - 'laravel': + laravel: container_name: laravel build: context: Docker/ @@ -18,7 +18,7 @@ services: - ./Website/config/php/php.ini:/usr/local/etc/php/php.ini - ./Website/htdocs:/var/www/html - 'ui': + ui: container_name: ui build: context: ./Website/ui/ @@ -29,7 +29,7 @@ services: - ./Website/ui:/usr/app/ - frontend_node_modules:/usr/app/node_modules/ - 'cron': + cron: container_name: cron_job build: context: Docker/ @@ -44,7 +44,7 @@ services: - ./Website/config/php/php.ini:/usr/local/etc/php/php.ini - ./Website/htdocs:/var/www/html - 'worker': + worker: container_name: worker restart: unless-stopped build: @@ -69,18 +69,19 @@ services: volumes: - ./Website/htdocs/mpmanager:/app - 'redis': + redis: + container_name: redis image: redis:5 volumes: - - ./redis/:/data + - redis_data:/data - 'maria': + maria: container_name: maria image: mariadb:10.3 env_file: - ./Docker/.env volumes: - - ./DB/mysql:/var/lib/mysql + - mariadb_data:/var/lib/mysql ports: - 3307:3306 @@ -112,3 +113,5 @@ services: volumes: frontend_node_modules: + mariadb_data: + redis_data: