version: "3"

services:
   apache:
    image: httpd:alpine
    links:
      - phpfpm
      - db
    volumes:
      - ./public_html:/usr/local/apache2/htdocs/
      - ./conf/httpd.conf:/usr/local/apache2/conf/httpd.conf
    environment:
      - FASTCGI=fcgi://phpfpm:9000
    hostname: "${HOSTNAME}"
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.5"

   phpfpm:
    build:
      context: .
      dockerfile: "./conf/php${PHP}"
    volumes:
      - ./public_html:/usr/local/apache2/htdocs/
      - ./conf/php.ini:/usr/local/etc/php/conf.d/50-setting.ini
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.6"

   db:
    image: mysql:latest
    volumes:
      - ./conf/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=123
      - MYSQL_DATABASE=dbname
      - MYSQL_USER=dbuser
      - MYSQL_PASSWORD=123
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.7"

networks:
  static-network:
    ipam:
      config:
        - subnet: "${IPADDRESS}.0/28"
version: "3"

services:
   apache:
    image: httpd:alpine
    links:
      - phpfpm
      - db
    volumes:
      - ./public_html:/usr/local/apache2/htdocs/
      - ./conf/httpd.conf:/usr/local/apache2/conf/httpd.conf
    environment:
      - FASTCGI=fcgi://phpfpm:9000
    hostname: "${HOSTNAME}"
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.5"

   phpfpm:
    build:
      context: .
      dockerfile: "./conf/php${PHP}"
    volumes:
      - ./public_html:/usr/local/apache2/htdocs/
      - ./conf/php.ini:/usr/local/etc/php/conf.d/50-setting.ini
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.6"

   db:
    image: mysql:5.7
    volumes:
      - ./conf/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=123
      - MYSQL_DATABASE=dbname
      - MYSQL_USER=dbuser
      - MYSQL_PASSWORD=123
    networks:
      static-network:
        ipv4_address: "${IPADDRESS}.7"

networks:
  static-network:
    ipam:
      config:
        - subnet: "${IPADDRESS}.0/28"
Set mysql to 5.7. J! doesn't work with newest versions.
Set mysql to 5.7. J! doesn't work with newest versions.
