Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Сергей Шевченко
Added: Dec 16, 2019 3:41 PM
Modified: Feb 3, 2020 11:47 AM
Views: 16
  1. version: '3.6'
  2.  
  3. networks:
  4.     ibs-backend-network:
  5.         name: ibs-backend-network
  6.         driver: bridge
  7.         ipam:
  8.             driver: default
  9.             config:
  10.                 -   subnet: "${IBS_BACKEND_NETWORK_SUBNET}.0/28"
  11.  
  12. volumes:
  13.     ibs-mysql-data:
  14.         name: ibs-mysql-data
  15.         driver: local
  16.  
  17. services:
  18.     ibs-mysql:
  19.         build:
  20.             args:
  21.                 APPLICATION_PATH: ${IBS_BACKEND_APPLICATION_PATH}
  22.                 MYSQL_USER: ${IBS_BACKEND_MYSQL_USER}
  23.                 MYSQL_PASSWORD: ${IBS_BACKEND_MYSQL_PASSWORD}
  24.                 MYSQL_ROOT_PASSWORD: ${IBS_BACKEND_MYSQL_ROOT_PASSWORD}
  25.                 MYSQL_DATABASE: ${IBS_BACKEND_MYSQL_DATABASE}
  26.             context: ./
  27.             dockerfile: ./build/${IBS_BACKEND_ENV}/db/mysql/Dockerfile
  28.         container_name: ibs-mysql
  29.         networks:
  30.             ibs-backend-network:
  31.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.2"
  32.         ports:
  33.             - ${IBS_BACKEND_MYSQL_HOST_PORT}:3306
  34.         restart:  always
  35.         tty: true
  36.         volumes:
  37.             - ./:${IBS_BACKEND_APPLICATION_PATH}/
  38.             - ibs-mysql-data:/var/lib/mysql/
  39.             - ./var/log/${IBS_BACKEND_ENV}/mysql/:/var/log/mysql/
  40.  
  41.     ibs-php-fpm:
  42.         build:
  43.             args:
  44.                 APPLICATION_PATH: ${IBS_BACKEND_APPLICATION_PATH}
  45.                 IBS_BACKEND_NETWORK_SUBNET: ${IBS_BACKEND_NETWORK_SUBNET}
  46.                 NGINX_HOST_HTTP_PORT: ${IBS_BACKEND_NGINX_HOST_HTTP_PORT}
  47.                 NGINX_HOST_HTTPS_PORT: ${IBS_BACKEND_NGINX_HOST_HTTPS_PORT}
  48.                 MYSQL_USER: ${IBS_BACKEND_MYSQL_USER}
  49.                 MYSQL_PASSWORD: ${IBS_BACKEND_MYSQL_PASSWORD}
  50.                 MYSQL_ROOT_PASSWORD: ${IBS_BACKEND_MYSQL_ROOT_PASSWORD}
  51.                 MYSQL_DATABASE: ${IBS_BACKEND_MYSQL_DATABASE}
  52.             context: ./
  53.             dockerfile: ./build/${IBS_BACKEND_ENV}/php-fpm/Dockerfile
  54.         container_name: ibs-php-fpm
  55.         depends_on:
  56.             - ibs-mysql
  57.         environment:
  58.             - "XDEBUG_CONFIG=remote_host=${IBS_BACKEND_NETWORK_SUBNET}.1 remote_enable=1"
  59.             - "PHP_IDE_CONFIG=serverName=${IBS_BACKEND_NETWORK_SUBNET}.4"
  60.         networks:
  61.             ibs-backend-network:
  62.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.3"
  63.         restart: always
  64.         tty: true
  65.         volumes:
  66.             - ./:${IBS_BACKEND_APPLICATION_PATH}/
  67.             - ./var/log/${IBS_BACKEND_ENV}/php-fpm/:/var/log/php-fpm/
  68.  
  69.     ibs-nginx:
  70.         build:
  71.             args:
  72.                 IBS_FRONTEND_NETWORK: "${IBS_FRONTEND_NETWORK}"
  73.             context: ./
  74.             dockerfile: ./build/${IBS_BACKEND_ENV}/server/nginx/Dockerfile
  75.         container_name: ibs-nginx
  76.         depends_on:
  77.             - ibs-php-fpm
  78.         networks:
  79.             ibs-backend-network:
  80.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.4"
  81.         ports:
  82.             - ${IBS_BACKEND_NGINX_HOST_HTTP_PORT}:80
  83.             - ${IBS_BACKEND_NGINX_HOST_HTTPS_PORT}:443
  84.         restart: always
  85.         tty: true
  86.         volumes:
  87.             - ./:${IBS_BACKEND_APPLICATION_PATH}/
  88.             - ./var/log/${IBS_BACKEND_ENV}/nginx/:/var/log/nginx/
  89.