version: '3.8'

services:
  kithkin-app:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    container_name: kithkin-app
    volumes:
      - .:/var/www/html
    environment:
      APP_ENV: production
      DB_HOST: kithkin-db
      DB_DATABASE: kithkin
      DB_USERNAME: kithkin
      DB_PASSWORD: secret
    depends_on:
      - kithkin-db

  kithkin-nginx:
    image: nginx:alpine
    container_name: kithkin-nginx
    ports:
      - "8080:80"
    volumes:
      - .:/var/www/html
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - kithkin-app

  kithkin-db:
    image: mysql:8
    container_name: kithkin-db
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: kithkin
      MYSQL_USER: kithkin
      MYSQL_PASSWORD: secret
    volumes:
      - kithkin-dbdata:/var/lib/mysql

volumes:
  kithkin-dbdata:
