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: Mar 31, 2020 2:41 PM
Views: 147
  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: "no"
  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.                 APP_ENV: ${IBS_BACKEND_APP_ENV}
  45.                 APPLICATION_PATH: ${IBS_BACKEND_APPLICATION_PATH}
  46.                 NETWORK_SUBNET: ${IBS_BACKEND_NETWORK_SUBNET}
  47.                 NGINX_HOST_HTTP_PORT: ${IBS_BACKEND_NGINX_HOST_HTTP_PORT}
  48.                 NGINX_HOST_HTTPS_PORT: ${IBS_BACKEND_NGINX_HOST_HTTPS_PORT}
  49.                 MYSQL_USER: ${IBS_BACKEND_MYSQL_USER}
  50.                 MYSQL_PASSWORD: ${IBS_BACKEND_MYSQL_PASSWORD}
  51.                 MYSQL_ROOT_PASSWORD: ${IBS_BACKEND_MYSQL_ROOT_PASSWORD}
  52.                 MYSQL_DATABASE: ${IBS_BACKEND_MYSQL_DATABASE}
  53.                 MAILER_TRANSPORT: ${IBS_BACKEND_MAILER_TRANSPORT}
  54.                 MAILER_HOST: ${IBS_BACKEND_MAILER_HOST}
  55.                 MAILER_PORT: ${IBS_BACKEND_MAILER_PORT}
  56.                 MAILER_USER: ${IBS_BACKEND_MAILER_USER}
  57.                 MAILER_PASSWORD: ${IBS_BACKEND_MAILER_PASSWORD}
  58.                 RUN_TEST_AFTER_INSTALL_PROJECT: ${IBS_BACKEND_RUN_TEST_AFTER_INSTALL_PROJECT}
  59.             context: ./
  60.             dockerfile: ./build/${IBS_BACKEND_ENV}/php-fpm/Dockerfile
  61.         container_name: ibs-php-fpm
  62.         depends_on:
  63.             - ibs-mysql
  64.         environment:
  65.             - "XDEBUG_CONFIG=remote_host=${IBS_BACKEND_NETWORK_SUBNET}.1 remote_enable=1"
  66.             - "PHP_IDE_CONFIG=serverName=${IBS_BACKEND_NETWORK_SUBNET}.4"
  67.         networks:
  68.             ibs-backend-network:
  69.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.3"
  70.         restart: "no"
  71.         tty: true
  72.         volumes:
  73.             - ./:${IBS_BACKEND_APPLICATION_PATH}/
  74.             - ./var/log/${IBS_BACKEND_ENV}/php-fpm/:/var/log/php-fpm/
  75.  
  76.     ibs-nginx:
  77.         build:
  78.             args:
  79.                 IBS_FRONTEND_NETWORK: "${IBS_FRONTEND_NETWORK}"
  80.             context: ./
  81.             dockerfile: ./build/${IBS_BACKEND_ENV}/server/nginx/Dockerfile
  82.         container_name: ibs-nginx
  83.         depends_on:
  84.             - ibs-php-fpm
  85.         networks:
  86.             ibs-backend-network:
  87.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.4"
  88.         ports:
  89.             - ${IBS_BACKEND_NGINX_HOST_HTTP_PORT}:80
  90.             - ${IBS_BACKEND_NGINX_HOST_HTTPS_PORT}:443
  91.         restart: "no"
  92.         tty: true
  93.         volumes:
  94.             - ./:${IBS_BACKEND_APPLICATION_PATH}/
  95.             - ./var/log/${IBS_BACKEND_ENV}/nginx/:/var/log/nginx/
  96.  
  97.     ibs-mailhog:
  98.         container_name: ibs-mailhog
  99.         image: mailhog/mailhog
  100.         ports:
  101.             - ${IBS_BACKEND_MAILER_PORT}:1025 # smtp server
  102.             - ${IBS_BACKEND_MAILER_WEB_UI_PORT}:8025 # web ui
  103.         restart: "no"
  104.         tty: true
  105.         networks:
  106.             ibs-backend-network:
  107.                 ipv4_address: "${IBS_BACKEND_NETWORK_SUBNET}.6"
  108.  
  109.     ibs-blackfire:
  110.         image: blackfire/blackfire
  111.         ports:
  112.             - ${IBS_BACKEND_BLACKFIRE_PORT}:8707
  113.         environment:
  114.             BLACKFIRE_LOG_LEVEL: ${IBS_BACKEND_BLACKFIRE_LOG_LEVEL} # (4: debug, 3: info, 2: warning, 1: error)
  115.             BLACKFIRE_SERVER_ID: ${IBS_BACKEND_BLACKFIRE_SERVER_ID}
  116.             BLACKFIRE_SERVER_TOKEN: ${IBS_BACKEND_BLACKFIRE_SERVER_TOKEN}
  117.             BLACKFIRE_CLIENT_ID: ${IBS_BACKEND_BLACKFIRE_CLIENT_ID}
  118.             BLACKFIRE_CLIENT_TOKEN: ${IBS_BACKEND_BLACKFIRE_CLIENT_TOKEN}
  119.