version: "3.10.5" services: app: build: . restart: unless-stopped command: uvicorn app.api:app --host 0.0.0.0 --port 8000 container_name: app ports: - 8000:8000 volumes: - .:/home/user/app environment: - PYTHONPATH=/home/user/app networks: example-network: ipv4_address: 172.16.238.10 # app2: # build: . # command: uvicorn app.api:app --reload --host 0.0.0.0 --port 8000 # container_name: "app2" # ports: # - 8002:8000 # volumes: # - .:/home/user/app # environment: # - PYTHONPATH=/home/user/app # depends_on: # - prometheus # nginx: # image: nginx:latest # container_name: "nginx" # ports: # - "8080:8080" # volumes: # - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf # depends_on: # - app # - app2 prometheus: image: prom/prometheus:latest restart: unless-stopped container_name: prometheus ports: - 9090:9090 volumes: - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml networks: example-network: ipv4_address: 172.16.238.11 grafana: image: grafana/grafana container_name: grafana restart: unless-stopped depends_on: - prometheus ports: - 3000:3000 volumes: - ./grafana/provisioning:/etc/grafana/provisioning env_file: - ./grafana/config.monitoring networks: example-network: ipv4_address: 172.16.238.12 tests: build: . volumes: - .:/home/user/app environment: - PYTHONPATH=/home/user/app depends_on: - app command: pytest tests networks: example-network: name: example-network driver: bridge ipam: driver: default config: - subnet: 172.16.238.0/24