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


services:

  manso:
    image: node:20-bookworm
    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]
    command: npm run dev

  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