-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
191 lines (179 loc) · 6.32 KB
/
Copy pathdocker-compose.yml
File metadata and controls
191 lines (179 loc) · 6.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
188
189
190
191
# docker-compose.yml
services:
# ─── Nginx reverse proxy ───────────────────────────────────────────────────
nginx:
image: nginx:alpine
container_name: aktiv_nginx
ports:
- "8080:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- frontend
- backend
restart: unless-stopped
# ─── Nuxt 3 frontend ───────────────────────────────────────────────────────
frontend:
image: node:20-alpine
container_name: aktiv_frontend
working_dir: /app
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ./frontend:/app
- ./version.json:/app/public/version.json:ro
environment:
- NUXT_PUBLIC_API_BASE=/api
- NUXT_PUBLIC_REVERB_KEY=${REVERB_APP_KEY}
- NUXT_PUBLIC_REVERB_HOST=localhost
- NUXT_PUBLIC_REVERB_PORT=8080
- NUXT_PUBLIC_REVERB_SCHEME=http
command: sh -c "npm install && npm run dev"
expose:
- "3000"
restart: unless-stopped
# ─── Laravel backend ───────────────────────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: aktiv_backend
working_dir: /var/www
volumes:
- ./backend:/var/www
- ./backend/.env:/var/www/.env
expose:
- "9000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_started
command: >
sh -c "
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache &&
chmod -R ug+rwX /var/www/storage /var/www/bootstrap/cache &&
php artisan config:clear &&
php artisan cache:clear &&
php-fpm
"
restart: unless-stopped
# ─── Laravel Reverb (WebSocket server) ────────────────────────────────────
reverb:
image: aktiv-backend
container_name: aktiv_reverb
working_dir: /var/www
volumes:
- ./backend:/var/www
- ./backend/.env:/var/www/.env
command: >
sh -c "
docker-php-ext-install pcntl &&
php artisan config:clear &&
php artisan reverb:start --host=0.0.0.0 --port=8080 --no-interaction
"
ports:
- "8081:8080"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
# ─── Laravel Queue Worker ─────────────────────────────────────────────────
queue:
image: aktiv-backend
container_name: aktiv_queue
working_dir: /var/www
volumes:
- ./backend:/var/www
- ./backend/.env:/var/www/.env
command: php artisan queue:work --sleep=3 --tries=3
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
# ─── Laravel Scheduler ────────────────────────────────────────────────────
scheduler:
image: aktiv-backend
container_name: aktiv_scheduler
working_dir: /var/www
volumes:
- ./backend:/var/www
- ./backend/.env:/var/www/.env
command: php artisan schedule:work
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
# ─── PostgreSQL database ───────────────────────────────────────────────────
db:
image: postgres:16-alpine
container_name: aktiv_db
ports:
- "5433:5432"
environment:
- POSTGRES_DB=${DB_DATABASE:-aktiv}
- POSTGRES_USER=${DB_USERNAME:-aktiv_user}
- POSTGRES_PASSWORD=${DB_PASSWORD:-secret}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-aktiv_user} -d ${DB_DATABASE:-aktiv}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
# ─── Redis ─────────────────────────────────────────────────────────────────
redis:
image: redis:alpine
container_name: aktiv_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
# ─── Mailpit (local email catcher) ────────────────────────────────────────
mailpit:
image: axllent/mailpit
container_name: aktiv_mailpit
ports:
- "8025:8025"
- "1025:1025"
restart: unless-stopped
# ─── MinIO (S3-compatible object storage) ────────────────────────────────
minio:
image: minio/minio:latest
container_name: aktiv_minio
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
restart: unless-stopped
# ─── MinIO bucket init ────────────────────────────────────────────────────
minio-init:
image: minio/mc:latest
container_name: aktiv_minio_init
depends_on:
- minio
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc alias set local http://minio:9000 ${MINIO_ROOT_USER:-minioadmin} ${MINIO_ROOT_PASSWORD:-minioadmin}) do echo '...waiting for minio...' && sleep 1; done;
/usr/bin/mc mb local/aktiv-media --ignore-existing;
/usr/bin/mc anonymous set public local/aktiv-media;
exit 0;
"
volumes:
db_data:
redis_data:
minio_data: