-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdocker-compose-dev.yaml
More file actions
129 lines (129 loc) · 3.23 KB
/
docker-compose-dev.yaml
File metadata and controls
129 lines (129 loc) · 3.23 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# compose config for running images based on local files
services:
ray-head:
user: "root"
container_name: ray-head
build:
context: ./
dockerfile: ray-node/Dockerfile
entrypoint: [
"env", "RAY_LOG_TO_STDERR=1", "ray", "start", "--head", "--port=6379",
"--dashboard-host=0.0.0.0", "--block"
]
ports:
- 8265:8265
volumes:
- host-shm:/dev/shm
- program-artifacts:/data
networks:
- safe-tier
postgres:
image: postgres
environment:
POSTGRES_DB: serverlessdb
POSTGRES_USER: serverlessuser
POSTGRES_PASSWORD: serverlesspassword
networks:
- safe-tier
ports:
- 5432:5432
restart:
always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U serverlessuser -d serverlessdb"]
interval: 1s
timeout: 5s
retries: 5
gateway:
container_name: gateway
build:
context: ./
dockerfile: gateway/Dockerfile
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
user: "root" # root user is needed to write on volumes and sync files from local system (see the watch: section)
environment:
- DEBUG=1
- RAY_HOST=http://ray-head:8265
- RAY_CLUSTER_MODE_LOCAL=true
- DJANGO_SUPERUSER_USERNAME=admin
- DJANGO_SUPERUSER_PASSWORD=123
- DJANGO_SUPERUSER_EMAIL=admin@noemail.com
- SITE_HOST=http://gateway:8000
- SETTINGS_AUTH_MECHANISM=mock_token
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=serverlessdb
- DATABASE_USER=serverlessuser
- DATABASE_PASSWORD=serverlesspassword
networks:
- safe-tier
volumes:
- program-artifacts:/usr/src/app/media/
depends_on:
postgres:
condition: service_healthy
develop:
watch:
- path: ./gateway
action: sync
target: /usr/src/app
scheduler:
user: "root" # root user is needed to write on volumes
container_name: scheduler
build:
context: ./
dockerfile: gateway/Dockerfile
entrypoint: "./entrypoint-scheduler.sh"
environment:
- DEBUG=1
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=serverlessdb
- DATABASE_USER=serverlessuser
- DATABASE_PASSWORD=serverlesspassword
- RAY_LOCAL_HOST=http://ray-head:8265
- RAY_CLUSTER_MODE_LOCAL=true
- SETTINGS_AUTH_MECHANISM=mock_token
networks:
- safe-tier
volumes:
- program-artifacts:/usr/src/app/media/
depends_on:
postgres:
condition: service_healthy
prometheus:
image: prom/prometheus:v2.44.0
profiles: [ "full" ]
ports:
- 9000:9090
loki:
image: grafana/loki:2.8.4
profiles: [ "full" ]
ports:
- 3100:3100
command: -config.file=/etc/loki/local-config.yaml
networks:
- safe-tier
promtail:
image: grafana/promtail:2.8.4
profiles: [ "full" ]
volumes:
- host-log:/var/log
command: -config.file=/etc/promtail/config.yml
networks:
- safe-tier
grafana:
image: grafana/grafana:latest
profiles: [ "full" ]
ports:
- 3000:3000
networks:
- safe-tier
networks:
safe-tier:
volumes:
program-artifacts:
host-shm:
host-log: