forked from HerveMignot/codecarbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (68 loc) · 2.08 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
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
# Avoid problems with local tox
- /carbonserver/.tox
ports:
- 8008:8000
environment:
# DATABASE_URL: sqlite:///./code_carbon.db
CODECARBON_LOG_LEVEL: DEBUG
DATABASE_URL: postgresql://${DATABASE_USER:-codecarbon-user}:${DATABASE_PASS:-supersecret}@postgres/${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:12
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
volumes:
postgres_data:
name: postgres_codecarbon_data
pgadmin:
name: pgadmin_codecarbon_data
networks:
codecarbon_net:
name: codecarbon_network