version: '3.7'
services:
  base:
    build:
      context: .
      dockerfile: ./docker/base/Dockerfile
    image: salvatti_base
    container_name: salvatti_base
  app:
    build:
      dockerfile: ./docker/dev/Dockerfile
      context: ./
    container_name: salvatti_app
    ports:
      - "8082:80"
    depends_on:
      - database
    volumes:
      - .:/var/www/salvatti
  database:
    image: 'mysql:8.0'
    container_name: salvatti_database
    restart: always
    environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: salvatti
    ports:
      - '3306'
    volumes:
      - salvatti_database_init:/docker-entrypoint-initdb.d/init.sql
      - salvatti_database_data:/var/lib/mysql
  phpmyadmin:
    depends_on:
      - database
    image: phpmyadmin/phpmyadmin
    container_name: salvatti_phpmyadmin
    ports:
      - '8088:80'
    environment:
      - PMA_HOST=database
      - MYSQL_ROOT_PASSWORD=password
volumes:
  salvatti_database_init:
    name: salvatti_database_init
    driver: local
  salvatti_database_data:
    name: salvatti_database_data
    driver: local


