Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 2.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (89 loc) · 2.03 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
services:
db:
image: timescale/timescaledb:latest-pg16
container_name: inverter_timescaledb
restart: always
env_file:
- ./backend/.env
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "5433:5432"
volumes:
- timescaledb_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: inverter_redis
restart: always
ports:
- "6379:6379"
backend:
build:
context: ./backend
dockerfile: ../backend.Dockerfile
container_name: inverter_backend
restart: always
env_file:
- ./backend/.env
environment:
DB_HOST: db
DB_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
ports:
- "8001:8001"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./backend:/app
command: >
sh -c "python manage.py migrate &&
daphne -b 0.0.0.0 -p 8001 core.asgi:application"
poller:
build:
context: ./backend
dockerfile: ../backend.Dockerfile
container_name: inverter_poller
restart: always
env_file:
- ./backend/.env
environment:
DB_HOST: db
DB_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
db:
condition: service_healthy
backend:
condition: service_started
volumes:
- ./backend:/app
command: python manage.py run_polling
frontend:
build:
context: ./frontend
dockerfile: ../frontend.Dockerfile
container_name: inverter_frontend
restart: always
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
volumes:
timescaledb_data: