File size: 1,845 Bytes
027e36f
92678a7
 
 
19f4044
134d85e
 
 
92678a7
134d85e
2c8418e
09e89a6
 
 
134d85e
 
 
898bea3
e2898af
 
 
 
 
 
 
 
 
 
 
 
92678a7
e2898af
 
 
 
 
 
 
 
 
 
92678a7
 
134d85e
 
92678a7
134d85e
 
92678a7
1bcd8bd
134d85e
 
 
92678a7
 
 
 
134d85e
92678a7
 
134d85e
 
 
 
 
66feea1
134d85e
 
 
92678a7
baf9ef4
134d85e
baf9ef4
14437ff
1dd39e4
 
baf9ef4
 
 
134d85e
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: "3.8"

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/provisioning/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