-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
44 lines (40 loc) · 948 Bytes
/
docker-compose.yml
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
version: '3.8'
services:
# Laravel App Service
app:
build:
context: .
dockerfile: Dockerfile
container_name: laravel_app
ports:
- "8080:80"
volumes:
- .:/var/www/html
depends_on:
- db
- redis
environment:
APP_ENV: local
APP_DEBUG: true
APP_KEY: ${APP_KEY}
# MySQL Database Service
db:
image: mysql:8.0
container_name: laravel_db
environment:
MYSQL_DATABASE: news
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: laravel
MYSQL_PASSWORD: secret
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
# Redis Service (optional)
redis:
image: redis:6-alpine
container_name: laravel_redis
ports:
- "6379:6379"
volumes:
db_data: