services:
  agenciapsi_app:
    container_name: agenciapsi_app
    image: node:20-alpine
    working_dir: /app
    volumes:
      - .:/app
      - agenciapsi_node_modules:/app/node_modules
    ports:
      - "5173:5173"
    command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
    environment:
      - NODE_ENV=development
    networks:
      - agenciapsi_net
    restart: unless-stopped

  agenciapsi_mysql:
    container_name: agenciapsi_mysql
    image: mysql:8.0
    ports:
      - "3307:3306"
    environment:
      MYSQL_ROOT_PASSWORD: agenciapsi123
      MYSQL_ROOT_HOST: "%"
      MYSQL_DATABASE: agenciapsi
      MYSQL_USER: agenciapsi
      MYSQL_PASSWORD: agenciapsi123
    volumes:
      - agenciapsi_mysql_data:/var/lib/mysql
    command: --default-authentication-plugin=mysql_native_password
    networks:
      - agenciapsi_net
    restart: always

volumes:
  agenciapsi_node_modules:
  agenciapsi_mysql_data:

networks:
  agenciapsi_net:
    driver: bridge
