-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
187 lines (176 loc) · 5.32 KB
/
docker-compose.yml
File metadata and controls
187 lines (176 loc) · 5.32 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File: docker-compose.yml
version: '3.8'
services:
# Nginx Web Server
nginx:
image: nginx:alpine
container_name: datasync_nginx
ports:
- "8000:80"
volumes:
- ./:/var/www/html
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
networks:
- datasync_network
restart: unless-stopped
# PHP-FPM Application
php:
build:
context: .
dockerfile: docker/php/Dockerfile
container_name: datasync_php
volumes:
- ./:/var/www/html
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
environment:
- DB_CONNECTION=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- PGSQL_HOST=postgres
- PGSQL_PORT=5432
- PGSQL_DATABASE=${PGSQL_DATABASE}
- PGSQL_USERNAME=${PGSQL_USERNAME}
- PGSQL_PASSWORD=${PGSQL_PASSWORD}
- MONGO_HOST=mongodb
- MONGO_PORT=27017
- MONGO_DATABASE=${MONGO_DATABASE}
- MONGO_USERNAME=${MONGO_USERNAME}
- MONGO_PASSWORD=${MONGO_PASSWORD}
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- mysql
- postgres
- mongodb
- redis
networks:
- datasync_network
restart: unless-stopped
# MySQL Database (Auth, Users, Wallet, Payments)
mysql:
image: mysql:8.0
container_name: datasync_mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
- ./docker/mysql/my.conf:/etc/mysql/conf.d/my.conf
networks:
- datasync_network
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
# PostgreSQL Database (Jobs, Projects, Offers)
postgres:
image: postgres:16-alpine
container_name: datasync_postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${PGSQL_DATABASE}
POSTGRES_USER: ${PGSQL_USERNAME}
POSTGRES_PASSWORD: ${PGSQL_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/postgresql.conf:/etc/postgresql/postgresql.conf
networks:
- datasync_network
restart: unless-stopped
command: postgres -c config_file=/etc/postgresql/postgresql.conf
# MongoDB Database (XP Logs, Badges, Events)
mongodb:
image: mongo:7.0
container_name: datasync_mongodb
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_DATABASE}
volumes:
- mongodb_data:/data/db
- ./docker/mongodb/mongod.conf:/etc/mongod.conf
networks:
- datasync_network
restart: unless-stopped
# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: datasync_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
networks:
- datasync_network
restart: unless-stopped
command: redis-server /usr/local/etc/redis/redis.conf
# Queue Worker
queue:
build:
context: .
dockerfile: docker/php/Dockerfile
container_name: datasync_queue
volumes:
- ./:/var/www/html
environment:
- DB_CONNECTION=mysql
- DB_HOST=mysql
- REDIS_HOST=redis
- QUEUE_CONNECTION=redis
depends_on:
- mysql
- redis
networks:
- datasync_network
restart: unless-stopped
command: php artisan queue:work --tries=3 --timeout=90
# Scheduler (Cron)
scheduler:
build:
context: .
dockerfile: docker/php/Dockerfile
container_name: datasync_scheduler
volumes:
- ./:/var/www/html
environment:
- DB_CONNECTION=mysql
- DB_HOST=mysql
depends_on:
- mysql
networks:
- datasync_network
restart: unless-stopped
command: sh -c "while true; do php artisan schedule:run --verbose --no-interaction & sleep 60; done"
# MailHog (Development Email Testing)
mailhog:
image: mailhog/mailhog:latest
container_name: datasync_mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
networks:
- datasync_network
restart: unless-stopped
networks:
datasync_network:
driver: bridge
volumes:
mysql_data:
driver: local
postgres_data:
driver: local
mongodb_data:
driver: local
redis_data:
driver: local