version: '3'

networks:
  likeadmin:
    driver: bridge

services:

  maven:
    container_name: likeadmin-java-maven
    image: maven:3.8.6-openjdk-8
    restart: always
    tty: true
    working_dir: /likeadmin_java/server
    volumes:
      - ../server:/likeadmin_java/server
    networks:
      - likeadmin
    ports:
      - "8082:8082"
      - "8083:8083"
    command: bash
  


  mysql:
    container_name: likeadmin-java-mysql
    image: mysql:5.7.29 #X86架构
    #image: amd64/mysql:5.7.29 #arm架构
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ../sql:/likeadmin_java/sql
      - ./data/mysql5.7.29/lib:/var/lib/mysql
      - ./config/mysql/mysqld.cnf:/etc/mysql/my.cnf
    networks:
      - likeadmin
    ports:
      - "3306:3306"


  redis:
    container_name: likeadmin-java-redis
    image: redis:7.0.4
    restart: always
    volumes:
      - ./data/redis:/data
    networks:
      - likeadmin
    ports:
      - "6379:6379"

  node:
    container_name: likeadmin-java-node
    image: node:14.18.1
    restart: always
    volumes:
      - ../admin:/likeadmin_php/admin
    networks:
      - likeadmin
    tty: true
    working_dir: /likeadmin_php/admin
    ports:
      - "5173:5173"
