version: "3.9"

services:
  app:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    container_name: designcontrol_app
    restart: unless-stopped
    volumes:
      - .:/var/www
    depends_on:
      - db

  nginx:
    image: nginx:alpine
    container_name: designcontrol_nginx
    restart: unless-stopped
    ports:
      - "8007:80"
    volumes:
      - .:/var/www
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app

  db:
    image: mysql:8.0
    container_name: designcontrol_db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: designcontrol
      MYSQL_USER: designcontrol
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - dbdata:/var/lib/mysql

volumes:
  dbdata:

