version: '3'

services:
  omni-server:
    build: ./.docker
    environment:
      - DB_HOST=omni-bike-checker_mysql_1
    image: omni
    depends_on:
      - mysql
    volumes:
      - ./:/app:cached

  mysql:
    image: mysql:8.0.19
    command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci','--default-authentication-plugin=mysql_native_password']
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=omni
    volumes:
      - ./storage/tmp/db:/var/lib/mysql:cached

  nginx:
    image: nginx
    ports:
      - "80:80"
    volumes:
      - ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf:cached
      - ./:/app:cached
    depends_on:
      - omni-server
