version: "2"
services:
  redis:
    container_name: redis
    image: redis:latest
    volumes:
      - /var/www/redis/data:/data
    ports:
      - "6379:6379"
    restart: on-failure
    networks:
      root_prenet:
        ipv4_address: 172.29.0.3
  mysql:
    container_name: mysql
    image: mysql:5.7.36
    environment:
      - MYSQL_ROOT_PASSWORD=safe2345@
    ports:
      - "3306:3306"
    volumes:
      - /mydata/mysql/log:/var/log/mysql
      - /mydata/mysql/data:/var/lib/mysql
      - /mydata/mysql/conf:/etc/mysql
    restart: on-failure
    networks:
      root_prenet:
        ipv4_address: 172.29.0.4
networks:
  root_prenet:
    external: true