# docker-compose.overrride.yml
# Docker Comose para entorno de desarrollo o development.


services:

  manso:
    image: node:20-bookworm
    # depends_on:
    #   db:
    #     condition: service_healthy
    #   tenants:
    #     condition: service_healthy
    # expose: 
    #   - ${APP_LOCAL_PORT}
    working_dir: /app
    user: "${UID:-1000}:${GID:-1000}"
    volumes:
      - ./services/manso:/app:rw
      - ./services/manso/node_modules:/app/node_modules
    env_file:
      - ./services/manso/.env.development
    environment:
      - NODE_ENV=${NODE_ENV}
    networks:
      net:
        aliases: [manso]
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:${APP_DOCKER_PORT}/health || exit 1"]
      interval: 10s
      timeout: 3s
      retries: 10
      start_period: 20s
    command: npm run dev
    profiles: [manso]
    restart: unless-stopped

  # db:
  #   image: postgres:16
  #   environment:
  #     POSTGRES_DB: ${DB_NAME}
  #     POSTGRES_USER: ${DB_USER}
  #     POSTGRES_PASSWORD: ${DB_PASS}
  #   volumes:
  #     - suitecoffee-db:/var/lib/postgresql/data
  #   networks:
  #     net:
  #       aliases: [dev-db]

  # tenants:
  #   image: postgres:16
  #   environment:
  #     POSTGRES_DB: ${TENANTS_DB_NAME}
  #     POSTGRES_USER: ${TENANTS_DB_USER}
  #     POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
  #   volumes:
  #     - tenants-db:/var/lib/postgresql/data
  #   networks:
  #     net:
  #       aliases: [dev-tenants]
      
volumes:
  tenants-db:
  suitecoffee-db:

networks:
  net:
    driver: bridge