services:
  app:
    build:
      context: ./ 
      dockerfile: Dockerfile
    container_name: avocat
    restart: unless-stopped
    working_dir: /var/www/
    user: "33:33"
    volumes:
      - ./:/var/www/
      - ./docker/php/:/usr/local/etc/php/conf.d/
  nginx:
    image: nginx:alpine
    container_name: avocat-nginx
    restart: always
    ports:
      - 8000:80
    volumes:
      - ./:/var/www/
      - ./docker/nginx/conf.d:/etc/nginx/conf.d/
  db:
    image: mysql:8.0
    container_name: avocat-mysql
    ports:
      - 3306:3306
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_USER: ${DB_USERNAME}
    volumes:
      - dbdata:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin:latest
    environment:
      - UPLOAD_LIMIT=3000M
    ports:
      - 81:80

volumes:
  dbdata: