version: '3.8'
services:  
  database:
    container_name: pvtchat_database
    image: mongo:5-focal
    ports: [27018:27017]
    volumes: [pvtchat:/data/db]
    restart: unless-stopped
  app:
    container_name: pvtchat_app
    depends_on: [database]
    build:
      context: ./
      dockerfile: Dockerfile.dev
    ports: [3000:3000, 3001:3001]
    env_file: [./backend/.env, ./frontend/env/.env.dev]
    volumes:
      - ./backend/src:/app/backend/src
      - ./backend/assets:/app/backend/assets
      - ./backend/logs:/app/backend/logs
      - ./frontend/src:/app/frontend/src
    restart: unless-stopped
volumes:
  pvtchat: