version: '3.8'

services:
  app:
    image: php:8.3-apache
    container_name: tuli_app
    ports:
      - "80:80"
    volumes:
      - ./tuli:/var/www/html
    depends_on:
      - db
    restart: always

  db:
    image: mysql:8.0
    container_name: tuli_db
    environment:
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_DATABASE: tuli_db
      MYSQL_USER: tuli_user
      MYSQL_PASSWORD: tuli_pass
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql
    restart: always

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: phpmyadmin
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: rootpassword
    ports:
      - "8080:80"
    depends_on:
      - db
    restart: always

  portainer:
    image: portainer/portainer-ce
    container_name: portainer
    ports:
      - "9000:9000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
    restart: always

volumes:
  db_data:
  portainer_data:

