-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (95 loc) · 2.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (95 loc) · 2.21 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
x-defaults: &defaults
environment:
- TZ=Europe/Warsaw
services:
# MariaDB Database
mariadb:
<<: *defaults
image: mariadb:11.4
container_name: bank-app-mariadb
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: ${DB_DATABASE:-backend}
MYSQL_USER: ${DB_USERNAME:-laravel}
MYSQL_PASSWORD: ${DB_PASSWORD:-laravel_password}
MARIADB_AUTO_UPGRADE: 'on'
MARIADB_DISABLE_ROOTSO: 1
ports:
- "3306:3306"
volumes:
- mariadb_data:/var/lib/mysql
- ./docker/scripts/mariadb:/docker-entrypoint-initdb.d
networks:
- bank-app-network
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
timeout: 5s
retries: 5
# Redis Cache
redis:
<<: *defaults
image: redis:7-alpine
container_name: bank-app-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- bank-app-network
command: redis-server --appendonly yes
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 5s
retries: 5
# Backend (Laravel with PHP-FPM + Nginx)
backend:
<<: *defaults
build:
context: ./backend
dockerfile: Dockerfile
container_name: bank-app-backend
environment:
APP_ENV: ${APP_ENV:-local}
APP_DEBUG: ${APP_DEBUG:-true}
APP_URL: ${APP_URL:-http://localhost:8000}
DB_CONNECTION: mysql
ports:
- "8000:80"
volumes:
- ./backend:/app
networks:
- bank-app-network
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
# Frontend (React)
frontend:
<<: *defaults
build:
context: ./frontend
dockerfile: Dockerfile
container_name: bank-app-frontend
environment:
VITE_API_URL: http://localhost:8000/api
NODE_ENV: development
ports:
- "5174:5174"
volumes:
- ./frontend:/app
networks:
- bank-app-network
depends_on:
- backend
links:
- "backend:backend"
command: npm run dev -- --host 0.0.0.0 --port 5174
volumes:
mariadb_data:
driver: local
redis_data:
driver: local
networks:
bank-app-network:
driver: bridge