version: '3.8'

services:
  web:
    image: php:8.1-apache
    volumes:
      - .:/var/www/html
    ports:
      - "8085:80"
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/html
    depends_on:
      - db
      - redis

  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: push_notifications
      MYSQL_USER: pushuser
      MYSQL_PASSWORD: pushpassword
    ports:
      - "3306:3306"

  redis:
    image: redis:alpine
    ports:
      - "6379:6379"

  worker:
    image: php:8.1-cli
    volumes:
      - .:/var/www/html
    command: php /var/www/html/worker.php
    depends_on:
      - db
      - redis
