-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
78 lines (72 loc) · 2.81 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
# Define named volumes for persistent data storage
volumes:
local_postgres_data: {} # Volume for PostgreSQL data
local_postgres_data_backups: {} # Volume for PostgreSQL data backups
local_redis_data: {} # Volume for Redis data
# Define services
services:
# Django service
django: &django
build:
context: .
dockerfile: ./compose/django/Dockerfile
container_name: vendor_management_system_django
depends_on:
- postgres
- redis
volumes:
- .:/app:z # Mount the current directory to /app in the container
env_file:
- ./.envs/.django.env
- ./.envs/.postgres.env # Load Django and PostgreSQL environment variables
ports:
- 8000:8000 # Map container port 8000 to host port 8000
command: /start # Start command for Django
# PostgreSQL service
postgres:
build:
context: .
dockerfile: ./compose/postgres/Dockerfile
container_name: vendor_management_system_local_postgres
volumes:
- local_postgres_data:/var/lib/postgresql/data # Mount volume for PostgreSQL data
- local_postgres_data_backups:/backups # Mount volume for PostgreSQL backups
env_file:
- ./.envs/.postgres.env # Load PostgreSQL environment variables
ports:
- 5432:5432 # Map container port 5432 to host port 5432
# Redis service
redis:
image: redis:7.2.5-alpine # Use Redis 7.2.5 Alpine image
container_name: vendor_management_system_local_redis
volumes:
- local_redis_data:/data # Mount volume for Redis data
ports:
- 6379:6379 # Map container port 6379 to host port 6379
# Celery worker service
celeryworker:
<<: *django # Inherit settings from the Django service
container_name: vendor_management_system_local_celeryworker
depends_on:
- redis
ports: [] # No ports exposed for Celery worker
command: /start-celeryworker # Start command for Celery worker
# Celery beat service
celerybeat:
<<: *django # Inherit settings from the Django service
container_name: vendor_management_system_local_celerybeat
depends_on:
- redis
- celeryworker
ports: [] # No ports exposed for Celery beat
command: /start-celerybeat # Start command for Celery beat
# Flower service for monitoring Celery
flower:
<<: *django # Inherit settings from the Django service
container_name: vendor_management_system_local_flower
depends_on:
- redis
- celeryworker
ports:
- 5555:5555 # Map container port 5555 to host port 5555
command: /start-flower # Start command for Flower