From ea15a2b87956862029c6ab9728d875907f84fd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ey=C3=BCp=20Erdo=C4=9Fan?= Date: Thu, 27 Jun 2024 15:39:41 +0300 Subject: [PATCH] Update docker compose names --- docker-compose-dev.yml | 118 +++++++++++++++++++++-------------------- docker-compose.yml | 98 ++++++++++++++++++---------------- 2 files changed, 112 insertions(+), 104 deletions(-) diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index cbbb52a..58436c9 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -1,62 +1,66 @@ -version: "3.8" +# Example Dev Environment Setup + +version: '3.8' + +name: ls_dev services: - # Laravel App X - laravel_app_x: - build: - context: ./src - container_name: laravel_app_x - restart: unless-stopped - ports: - - ${LARAVEL_APP_X_PORT}:8000 - volumes: - - ./src:/var/www/html - environment: - RUN_LARAVEL_AUTOMATIONS: "true" - command: php -S laravel_app_x:8000 -t ./public - networks: - - mysql_net - - redis_net - - # MySQL - laravel_mysql_db: - image: mysql:latest - container_name: laravel_mysql_db - restart: unless-stopped - ports: - - ${MYSQL_PORT}:3306 - environment: - MYSQL_DATABASE: ${MYSQL_DB} - ON_CREATE_DB: ${MYSQL_DB} - MYSQL_USER: ${MYSQL_USER} - MYSQL_PASSWORD: ${MYSQL_PASSWORD} - MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} - networks: - - mysql_net - - # Redis - laravel_redis: - image: redis:alpine - container_name: laravel_redis - hostname: laravel_app_x - restart: always - ports: - - ${LARAVEL_REDIS_POST}:6379 - networks: - - redis_net - - # MailHog Server - laravel_mail_hog: - image: mailhog/mailhog:latest - container_name: laravel_mail_hog - restart: unless-stopped - ports: - - 10001:1025 - - 10002:8025 + # Laravel App X + laravel_app_x: + build: + context: ./src + container_name: laravel_app_x + restart: unless-stopped + ports: + - ${LARAVEL_APP_X_PORT}:8000 + volumes: + - ./src:/var/www/html + environment: + RUN_LARAVEL_AUTOMATIONS: 'true' + command: php -S laravel_app_x:8000 -t ./public + networks: + - mysql_net + - redis_net + + # MySQL + laravel_mysql_db: + image: mysql:latest + container_name: laravel_mysql_db + restart: unless-stopped + ports: + - ${MYSQL_PORT}:3306 + environment: + MYSQL_DATABASE: ${MYSQL_DB} + ON_CREATE_DB: ${MYSQL_DB} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + networks: + - mysql_net + + # Redis + laravel_redis: + image: redis:alpine + container_name: laravel_redis + hostname: laravel_app_x + restart: always + ports: + - ${LARAVEL_REDIS_POST}:6379 + networks: + - redis_net + + # MailHog Server + laravel_mail_hog: + image: mailhog/mailhog:latest + container_name: laravel_mail_hog + restart: unless-stopped + ports: + - 10001:1025 + - 10002:8025 networks: - mysql_net: - driver: bridge + mysql_net: + driver: bridge - redis_net: - driver: bridge + redis_net: + driver: bridge diff --git a/docker-compose.yml b/docker-compose.yml index e9ed7d6..babbdc8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,54 +1,58 @@ -version: "3.8" +# Example Prod Environment Setup + +version: '3.8' + +name: ls_prod services: - # Laravel Starter App - laravel_starter_app: - image: serversideup/php:8.2-fpm-nginx - container_name: laravel_starter_app - stdin_open: true - tty: true - ports: - - ${WEB_APP_PORT}:80 - volumes: - - ./:/var/www/html - environment: - RUN_LARAVEL_AUTOMATIONS: "false" - AUTORUN_ENABLED: "true" - AUTORUN_LARAVEL_STORAGE_LINK: "false" - networks: - - mysql_net - - redis_net + # Laravel Starter App + laravel_starter_app: + image: serversideup/php:8.2-fpm-nginx + container_name: laravel_starter_app + stdin_open: true + tty: true + ports: + - ${WEB_APP_PORT}:80 + volumes: + - ./:/var/www/html + environment: + RUN_LARAVEL_AUTOMATIONS: 'false' + AUTORUN_ENABLED: 'true' + AUTORUN_LARAVEL_STORAGE_LINK: 'false' + networks: + - mysql_net + - redis_net - # MySQL - laravel_mysql_db: - image: mysql:latest - container_name: laravel_mysql_db - restart: unless-stopped - ports: - - ${MYSQL_PORT}:3306 - environment: - MYSQL_DATABASE: ${MYSQL_DB} - ON_CREATE_DB: ${MYSQL_DB} - MYSQL_USER: ${MYSQL_USER} - MYSQL_PASSWORD: ${MYSQL_PASSWORD} - MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} - networks: - - mysql_net + # MySQL + laravel_mysql_db: + image: mysql:latest + container_name: laravel_mysql_db + restart: unless-stopped + ports: + - ${MYSQL_PORT}:3306 + environment: + MYSQL_DATABASE: ${MYSQL_DB} + ON_CREATE_DB: ${MYSQL_DB} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + networks: + - mysql_net - # Redis - laravel_redis: - image: redis:alpine - container_name: laravel_redis - hostname: laravel_starter_app - restart: always - ports: - - ${LARAVEL_REDIS_POST}:6379 - networks: - - redis_net + # Redis + laravel_redis: + image: redis:alpine + container_name: laravel_redis + hostname: laravel_starter_app + restart: always + ports: + - ${LARAVEL_REDIS_POST}:6379 + networks: + - redis_net networks: - mysql_net: - driver: bridge + mysql_net: + driver: bridge - redis_net: - driver: bridge + redis_net: + driver: bridge