version: '3.4'

services:
  nginx:
    image: nginx:latest
    ports:
      - "8080:80"
    volumes:
      - ./front:/var/www/front:cached
      - ./api:/var/www/api:cached
      - ./docker/nginx/cojedzie.conf:/etc/nginx/conf.d/cojedzie.conf

  api:
    build:
      context: ./api
      dockerfile: dev.Dockerfile
    env_file:
      - ./docker/php/.env
    volumes:
      - ./api:/var/www:cached
      - ./docker/php/log.conf:/usr/local/etc/php-fpm.d/zz-log.conf

  frontend:
    image: node:15.2.1
    working_dir: /app
    environment:
      - APP_API=http://nginx/api
    volumes:
      - ./front:/app
    command: ["node", "build/server.js"]

  blackfire:
    image: blackfire/blackfire
    ports: ["8707"]
    environment:
      - BLACKFIRE_SERVER_ID
      - BLACKFIRE_SERVER_TOKEN
