-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.local.yml
153 lines (142 loc) · 5.9 KB
/
docker-compose.local.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
volumes:
local_postgres_data: {} # Volume for PostgreSQL data
local_postgres_data_backups: {} # Volume for PostgreSQL backups
local_minio_data: {} # Volume for MinIO data
local_mailpit_data: {} # Volume for Mailpit data
local_redis_data: {} # Volume for Redis data
local_logs_nginx: {} # Volume for Nginx
local_node_modules: {} # Volume for Client Node Modules
services:
# Define the application server service
server: &server
build:
context: . # Build context is the current directory
dockerfile: ./compose/local/server/Dockerfile # Dockerfile path for the server
container_name: alpha_apartments_local_server # Container name
depends_on:
# Dependencies for the server service
- postgres
- redis
- mailpit
- minio
volumes:
- ./server:/app:z # Mount the server directory to the container
env_file:
# Environment files for the server
- ./.envs/.local/.django.env
- ./.envs/.local/.postgres.env
command: /start # Command to run when the container starts
networks:
- alpha_apartments_network # Network for the server service
# Define the PostgreSQL service
postgres:
build:
context: . # Build context is the current directory
dockerfile: ./compose/local/postgres/Dockerfile # Dockerfile path for PostgreSQL
container_name: alpha_apartments_local_postgres # Container name
volumes:
- local_postgres_data:/var/lib/postgresql/data # Mount the PostgreSQL data volume
- local_postgres_data_backups:/backups # Mount the PostgreSQL backups volume
env_file:
- ./.envs/.local/.postgres.env # Environment file for PostgreSQL
networks:
- alpha_apartments_network # Network for PostgreSQL
# Define the MinIO service
minio:
image: minio/minio # MinIO image
container_name: alpha_apartments_local_minio # Container name
volumes:
- local_minio_data:/data # Mount the MinIO data volume
ports:
- "9090:9090" # Expose port 9090 for MinIO console
env_file:
- ./.envs/.local/.minio.env # Environment file for MinIO
command: server --console-address :9090 --address :9000 /data # Command to start MinIO
networks:
- alpha_apartments_network # Network for MinIO
# Define the Mailpit service
mailpit:
image: docker.io/axllent/mailpit:latest # Mailpit image
container_name: alpha_apartments_local_mailpit # Container name
volumes:
- local_mailpit_data:/data # Mount the Mailpit data volume
ports:
- "8025:8025" # Expose port 8025 for Mailpit web interface
env_file:
- ./.envs/.local/.mailpit.env # Environment file for Mailpit
networks:
- alpha_apartments_network # Network for Mailpit
# Define the Redis service
redis:
image: docker.io/redis:6 # Redis image
container_name: alpha_apartments_local_redis # Container name
volumes:
- local_redis_data:/data # Mount the Redis data volume
networks:
- alpha_apartments_network # Network for Redis
# Define the Celery worker service
celeryworker:
<<: *server # Use the server configuration
container_name: alpha_apartments_local_celeryworker # Container name
depends_on:
# Dependencies for the Celery worker service
- redis
- postgres
- mailpit
ports: []
command: /start-celeryworker # Command to start the Celery worker
networks:
- alpha_apartments_network # Network for the Celery worker service
# Define the Celery beat service
celerybeat:
<<: *server # Use the server configuration
container_name: alpha_apartments_local_celerybeat # Container name
depends_on:
# Dependencies for the Celery beat service
- redis
- postgres
- mailpit
ports: []
command: /start-celerybeat # Command to start the Celery beat
networks:
- alpha_apartments_network # Network for the Celery beat service
# Define the Flower service
flower:
<<: *server # Use the server configuration
container_name: alpha_apartments_local_flower # Container name
command: /start-flower # Command to start Flower
ports:
- "5555:5555" # Expose port 5555 for Flower
networks:
- alpha_apartments_network # Network for Flower
# Define the Client service
client:
build:
context: . # Build context is the current directory
dockerfile: ./compose/local/client/Dockerfile # Dockerfile path for Client
container_name: alpah_apartments_local_client # Container name
depends_on:
# Dependencies for Client service
- server
volumes:
- ./client:/app # Mount the client directory to docker
- local_node_modules:/app/node_modules # Mount the client node modules
networks:
- alpha_apartments_network # Network for Client
# Define the Nginx service
nginx:
build:
context: . # Build context is the current directory
dockerfile: ./compose/local/nginx/Dockerfile # Dockerfile path for Nginx
container_name: alpha_apartments_local_nginx # Container name
depends_on:
# Dependencies for the Nginx service
- server
ports:
- "8080:80" # Expose port 8080 for Nginx
volumes:
- local_logs_nginx:/var/log/nginx # Mount the Nginx logs volume
networks:
- alpha_apartments_network # Network for Nginx
networks:
alpha_apartments_network: # Define a network for all services