version: '3.8'

services:
  postgres:
    image: postgres:15-alpine
    container_name: app_postgres
    environment:
      POSTGRES_DB: app_db
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - '5433:5432'
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    networks:
      - app_network

  mongodb:
    image: mongo:7.0
    container_name: app_mongodb
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: mongodb
      MONGO_INITDB_DATABASE: operation_db
    ports:
      - '27019:27017'
    volumes:
      - mongodb_data:/data/db
    networks:
      - app_network

  # app:
  #   build: .
  #   container_name: app_backend
  #   environment:
  #     - DATABASE_URL=postgres://postgres:postgres@postgres:5432/app_db
  #     - MONGODB_URL=mongodb://root:mongodb@mongodb:27017/operation_db?authSource=admin
  #     - NODE_ENV=production
  #   ports:
  #     - '3000:3000'
  #   depends_on:
  #     - postgres
  #     - mongodb
  #   networks:
  #     - app_network
  #   volumes:
  #     - .:/app
  #     - /app/node_modules

volumes:
  postgres_data:
  mongodb_data:

networks:
  app_network:
    driver: bridge
