version: '3'
services:
  mysql:
    image: mysql:8.0
    container_name: mysql-admin
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: admin,pay
    volumes:
      - /my/own/datadir:/var/lib/mysql
    ports:
      - "3306:3306"
  redis:
    image: redis:7.0
    container_name: redis-admin
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    restart: always
    command: ["redis-server", "--appendonly", "yes"]

  admin-center:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: admin-center
    ports:
      - "10051:10051"
    volumes:
      - ./app:/app
    depends_on:
      - mysql
      - redis

volumes:
  redis_data: