version: '3.8'

services:
  db:
    image: docker-db
    container_name: docker_db
    build:
      context: ./
      dockerfile: Dockerfile.db
    ports:
      - "9042:9042"
    networks:
      - vcpe-network
    volumes:
      - cassandra_data:/var/lib/cassandra  # Persist Cassandra data
    environment:
      - CASSANDRA_CLUSTER_NAME=mycluster

  app:
    image: docker-webconfig
    container_name: docker_webconfig
    build:
      context: ./
      dockerfile: Dockerfile.app
    networks:
      - vcpe-network
    ports:
      - "9007:9007"
    depends_on:
      - db

networks:
  vcpe-network:
    driver: bridge

volumes:
  cassandra_data:  # Define the named volume
    driver: local
