version: "3.1" services: server: build: context: ./ dockerfile: dockerfile volumes: - .:/opt/project ports: - 8080:8080 networks: - mynetwork prometheus: image: prom/prometheus volumes: - ./prometheus/:/etc/prometheus/ command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' ports: - 9090:9090 networks: - mynetwork grafana: image: grafana/grafana ports: - 3000:3000 networks: - mynetwork networks: mynetwork: