version: '3'

volumes:
  mysql-db:

networks:
  default:
    name: local
    external: true

services:
  www-web:
    image: uvoelkel/php-dev:8.2
    labels:
      - traefik.enable=true
      - traefik.http.routers.www-security-baseplus.tls=true
      - traefik.http.routers.www-security-baseplus.tls.certresolver=local
      - traefik.http.routers.www-security-baseplus.rule=Host(`security.baseplus.${DEV_DOMAIN}`)
    volumes:
      - ./:/var/www/html/:cached
    hostname: baseplus-security
    environment:
      - APACHE_RUN_UID
      - APACHE_RUN_GID
      - DOCKER_HOST_OS
      - DOCUMENT_ROOT=public

  db:
    image: mysql:5.7
    volumes:
      - mysql-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_USER=dbuser
      - MYSQL_PASSWORD=dbpassword
      - MYSQL_DATABASE=symfony
