-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
46 lines (43 loc) · 1.22 KB
/
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
45
46
version: '3.7'
services:
php-fpm:
build:
context: ./docker/php-fpm
container_name: "${PROJECT_NAME}_php-fpm"
depends_on:
- database
environment:
- APP_ENV=${APP_ENV}
- APP_SECRET=${APP_SECRET}
- DATABASE_URL=mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@database:3306/${DATABASE_NAME}?serverVersion=5.7
volumes:
- ../app:/var/www
nginx:
build:
context: ./docker/nginx
container_name: "${PROJECT_NAME}_nginx"
volumes:
- ./app:/var/www
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/sites/:/etc/nginx/sites-available
- ./docker/nginx/conf.d/:/etc/nginx/conf.d
- ./docker/logs:/var/log
depends_on:
- php-fpm
ports:
- "80:80"
- "443:443"
database:
build:
context: ./docker/database
container_name: "${PROJECT_NAME}_database"
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USER=${DATABASE_USER}
- MYSQL_PASSWORD=${DATABASE_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DATABASE_ROOT_PASSWORD}
ports:
- "3306:3306"
volumes:
- ./docker/database/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./docker/database/data:/var/lib/mysql