forked from mlco2/codecarbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
85 lines (77 loc) · 2.32 KB
/
docker-compose.yml
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
version: '3.7'
services:
# codecarbon_package:
# build:
# context: ./codecarbon/
# dockerfile: ./docker/Dockerfile
# networks:
# - codecarbon_net
# volumes:
# - ./codecarbon:/opt/codecarbon
# depends_on:
# - codecarbon_api
# restart: unless-stopped
carbonserver:
build:
context: ./carbonserver/
dockerfile: ./docker/Dockerfile
#command: cd /carbonserver/carbonserver/database && python3 -m alembic upgrade head && cd ../.. && uvicorn --reload main:app --host 0.0.0.0
volumes:
- ./carbonserver:/carbonserver
ports:
- 8008:8000
environment:
CODECARBON_LOG_LEVEL: DEBUG
DATABASE_URL: postgresql://${DATABASE_USER:-codecarbon-user}:${DATABASE_PASS:-supersecret}@${DATABASE_HOST:-postgres}:${DATABASE_PORT:-5432}/${DATABASE_NAME:-codecarbon_db}
networks:
- codecarbon_net
postgres:
container_name: ${DATABASE_HOST:-postgres_codecarbon}
environment:
HOSTNAME: ${DATABASE_HOST:-postgres_codecarbon}
POSTGRES_DB: ${DATABASE_NAME:-codecarbon_db}
POSTGRES_PASSWORD: ${DATABASE_PASS:-supersecret}
POSTGRES_USER: ${DATABASE_USER:-codecarbon-user}
image: postgres:13
networks:
- codecarbon_net
ports:
- 5480:5432
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data:rw
pgadmin:
container_name: pgadmin_codecarbon
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-test}
volumes:
- pgadmin:/root/.pgadmin
- ./carbonserver/docker/pgpassfile:/pgadmin4/pgpassfile
- ./carbonserver/docker/pgadmin-servers.json:/pgadmin4/servers.json
ports:
- "${PGADMIN_PORT:-5080}:80"
networks:
- codecarbon_net
restart: unless-stopped
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./docker/prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- "prometheus-pushgateway"
prometheus-pushgateway:
image: prom/pushgateway
ports:
- "9091:9091"
volumes:
postgres_data:
name: postgres_codecarbon_data
pgadmin:
name: pgadmin_codecarbon_data
networks:
codecarbon_net:
name: codecarbon_network