-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (126 loc) · 3.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
134 lines (126 loc) · 3.24 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
# FUTEBUS — development stack.
#
# docker compose up --build
#
# The application source is bind-mounted so code changes are reflected live.
# MySQL and Redis run as containers; assets are built with the "vite" service
# or on the host (npm run dev). This does not affect your existing Laragon
# workflow — it is an alternative, self-contained environment.
services:
app:
build:
context: .
target: development
image: futabus-app:dev
restart: unless-stopped
working_dir: /var/www/html
env_file:
- .env
environment:
APP_ENV: local
APP_DEBUG: "true"
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: "3306"
DB_DATABASE: ${DB_DATABASE:-futabus}
DB_USERNAME: ${DB_USERNAME:-futabus}
DB_PASSWORD: ${DB_PASSWORD:-secret}
REDIS_HOST: redis
REDIS_PORT: "6379"
CACHE_STORE: redis
SESSION_DRIVER: redis
QUEUE_CONNECTION: redis
OPTIMIZE: "false"
volumes:
- .:/var/www/html
- /var/www/html/node_modules
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- futabus
nginx:
image: nginx:1.27-alpine
restart: unless-stopped
ports:
- "${APP_PORT:-8000}:80"
volumes:
- ./public:/var/www/html/public:ro
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- app
networks:
- futabus
# Queue worker (database/redis backed). Uses the same app image.
queue:
image: futabus-app:dev
restart: unless-stopped
working_dir: /var/www/html
env_file:
- .env
environment:
APP_ENV: local
DB_CONNECTION: mysql
DB_HOST: mysql
REDIS_HOST: redis
QUEUE_CONNECTION: redis
OPTIMIZE: "false"
WAIT_FOR_DB: "true"
command: ["php", "artisan", "queue:work", "--tries=3", "--timeout=90", "--sleep=3"]
volumes:
- .:/var/www/html
- /var/www/html/node_modules
depends_on:
- app
networks:
- futabus
# Vite dev server for hot asset building (optional).
vite:
image: node:20-alpine
working_dir: /app
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
ports:
- "5173:5173"
volumes:
- .:/app
- /app/node_modules
networks:
- futabus
mysql:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE:-futabus}
MYSQL_USER: ${DB_USERNAME:-futabus}
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootsecret}
ports:
- "${DB_FORWARD_PORT:-33070}:3306"
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${DB_ROOT_PASSWORD:-rootsecret}"]
interval: 10s
timeout: 5s
retries: 10
networks:
- futabus
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "${REDIS_FORWARD_PORT:-63790}:6379"
volumes:
- redis-data:/data
networks:
- futabus
volumes:
mysql-data:
redis-data:
networks:
futabus:
driver: bridge