services:
  app:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    image: thankcard-system-app
    container_name: thankcard-system-app
    working_dir: /var/www/html
    volumes:
      - ..:/var/www/html

    networks:
      - thankcard-system-network
    extra_hosts:
      - "host.docker.internal:host-gateway"

  nginx:
    image: nginx:1.25-alpine
    container_name: thankcard-system-nginx
    ports:
      - "8888:80"
    volumes:
      - ..:/var/www/html
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app
    networks:
      - thankcard-system-network

  node:
    image: node:20-alpine
    container_name: thankcard-system-node
    working_dir: /var/www/html
    volumes:
      - ..:/var/www/html
    command: tail -f /dev/null
    ports:
      - "5173:5173"
    networks:
      - thankcard-system-network

networks:
  thankcard-system-network:
    name: thankcard-system-network
