version: '3'
networks:
  webar_network:
    driver: bridge
services:
  back:
    build:
      context: .
      dockerfile: ./Dockerfile
    image: webar-api
    container_name: webar-api
    ports:
      - 3010:${APP_PORT}
    environment:
      - DB_URL=${DB_URL}
      - JWT_SECRET=${JWT_SECRET}
      - APP_PORT=${APP_PORT}
      - APP_URL=${APP_URL}
    depends_on:
      - db
    volumes:
      - ./:/app
      # - /app/node_modules
    restart: always
    networks:
      - webar_network
    command: npm start
  db:
    image: mongo
    container_name: webar-db
    environment:
      - MONGO_INITDB_DATABASE=${DB_NAME}
    ports:
      - 27017:27017
    networks:
      - webar_network
