-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (98 loc) · 2.04 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
services:
backend:
build:
context: ./srcs/backend
container_name: django
entrypoint: |
bash -c "
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000
"
env_file: .env
ports:
- ${DJANGO_PORT}:8000
volumes:
- backend_vol:/backend
- /backend/static
depends_on:
- postgresql
- redis
networks:
- trans_network
restart: always
nginx:
build:
context: ./srcs/nginx
container_name: nginx
env_file: .env
ports:
- ${NGINX_PORT}:80
- ${NGINX_PORT_SSL}:443
depends_on:
- backend
# - grafana
- redis
- postgresql
volumes:
- ./srcs/nginx:/etc/nginx/conf.d
- ./srcs/backend/static:/usr/share/nginx/html/static
- ./srcs/frontend:/usr/share/nginx/html
- ./srcs/frontend/static:/usr/share/nginx/html/static
networks:
- trans_network
restart: always
postgresql:
image: postgres:17.0
container_name: postgres
env_file: .env
ports:
- ${DB_PORT}:5432
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- trans_network
restart: always
redis:
image: redis:7.4.1-alpine
container_name: redis
env_file: .env
ports:
- ${REDIS_PORT}:6379
volumes:
- redis_data:/data
command:
- redis-server
- --appendonly yes
- --requirepass "${REDIS_PASSWORD}"
- --maxmemory 10mb
- --maxmemory-policy allkeys-lru
networks:
- trans_network
restart: always
# grafana:
# image: grafana/grafana:latest
# container_name: grafana
# env_file: .env
# ports:
# - ${GRAFANA_PORT}:3000
# volumes:
# - grafana-data:/var/lib/grafana
# networks:
# - trans_network
# restart: always
volumes:
backend_vol:
driver: local
driver_opts:
type: none
o: bind
device: ./srcs/backend/
pgdata:
driver: local
redis_data:
driver: local
grafana-data:
driver: local
networks:
trans_network:
driver: bridge