-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (164 loc) · 3.81 KB
/
Copy pathdocker-compose.yml
File metadata and controls
172 lines (164 loc) · 3.81 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
services:
# Laravel Application
app:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: redo-app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- .:/var/www/html
- ./storage:/var/www/html/storage
- ./bootstrap/cache:/var/www/html/bootstrap/cache
environment:
- APP_ENV=local
- APP_DEBUG=true
- DB_CONNECTION=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=redo
- DB_USERNAME=redo_user
- DB_PASSWORD=redo_password
- REDIS_HOST=redis
- REDIS_PORT=6379
- CACHE_STORE=redis
- SESSION_DRIVER=redis
- QUEUE_CONNECTION=redis
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- redo-network
# Nginx Web Server
nginx:
image: nginx:alpine
container_name: redo-nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- .:/var/www/html
- ./docker/nginx/nginx-simple.conf:/etc/nginx/nginx.conf
depends_on:
- app
networks:
- redo-network
# MySQL Database
mysql:
image: mysql:8.0
container_name: redo-mysql
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: redo
MYSQL_USER: redo_user
MYSQL_PASSWORD: redo_password
MYSQL_ROOT_PASSWORD: root_password
volumes:
- mysql_data:/var/lib/mysql
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
networks:
- redo-network
# Redis Cache
redis:
image: redis:7-alpine
container_name: redo-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
networks:
- redo-network
# Node.js for development (Vite dev server)
vite:
image: node:20-alpine
container_name: redo-vite
working_dir: /app
volumes:
- .:/app
- node_modules:/app/node_modules
ports:
- "5173:5173"
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
networks:
- redo-network
# Queue Worker
queue:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: redo-queue
restart: unless-stopped
working_dir: /var/www/html
volumes:
- .:/var/www/html
environment:
- APP_ENV=local
- DB_CONNECTION=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=redo
- DB_USERNAME=redo_user
- DB_PASSWORD=redo_password
- REDIS_HOST=redis
- REDIS_PORT=6379
- QUEUE_CONNECTION=redis
command: php artisan queue:work --tries=3 --timeout=90
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- redo-network
# Scheduler (Laravel Cron)
scheduler:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: redo-scheduler
restart: unless-stopped
working_dir: /var/www/html
volumes:
- .:/var/www/html
environment:
- APP_ENV=local
- DB_CONNECTION=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=redo
- DB_USERNAME=redo_user
- DB_PASSWORD=redo_password
- REDIS_HOST=redis
- REDIS_PORT=6379
command: sh -c "while true; do php artisan schedule:run; sleep 60; done"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- redo-network
volumes:
mysql_data:
driver: local
redis_data:
driver: local
node_modules:
driver: local
networks:
redo-network:
driver: bridge