-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (68 loc) · 1.44 KB
/
docker-compose.yml
File metadata and controls
74 lines (68 loc) · 1.44 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
# Laravel Docker Compose
services:
# PHP-FPM Application
app:
build:
context: .
dockerfile: Dockerfile
args:
USER_ID: 1000
GROUP_ID: 1000
container_name: laravel_app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./:/var/www/html
- ./vendor:/var/www/html/vendor
networks:
- laravel_network
depends_on:
- mysql
- redis
# Nginx Web Server
nginx:
image: nginx:alpine
container_name: laravel_nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./:/var/www/html
- ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- laravel_network
depends_on:
- app
# MySQL Database
mysql:
image: mysql:8.0
container_name: laravel_mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE:-laravel}
MYSQL_USER: ${DB_USERNAME:-laravel}
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-secret}
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- laravel_network
# Redis Cache
redis:
image: redis:alpine
container_name: laravel_redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- laravel_network
networks:
laravel_network:
driver: bridge
volumes:
mysql_data:
redis_data: