services:
  app:
    build: 
      context: .
      dockerfile: dockerfile/Dockerfile
    container_name: next_magricambi
    restart: always
    env_file:
      - .env
    environment:
      MYSQL_HOST: mysql
    ports:
      - "127.0.0.1:3001:3000"
    depends_on:
      - mysql

  mysql:
    image: mysql:8.0
    container_name: mysql_magricambi
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    volumes:
      - dbdata:/var/lib/mysql
    ports:
      - "127.0.0.1:3306:3306"

  phpmyadmin:
    image: phpmyadmin:latest
    restart: always
    ports:
      - "127.0.0.1:8082:80"
    environment:
      PMA_HOST: mysql
    depends_on:
      - mysql

volumes:
  dbdata:

