forked from cslant/lemp-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·94 lines (87 loc) · 2.33 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
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
version: '3.9'
networks:
nginx:
services:
#PHP service
server:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- PHP_VERSION_SELECTED=${PHP_VERSION_SELECTED}
- PHP_VERSION=${PHP_VERSION_SELECTED}
container_name: '${APP_NAME}-server'
working_dir: /var/www/
volumes:
- ./sources:/var/www
- ./docker/server/php/php.ini:/usr/local/etc/php/conf.d/extra-php-config.ini
- ./docker/server/php/php-xdebug.ini:/usr/local/etc/php/conf.d/zz-xdebug-settings.ini
networks:
- nginx
#nginx service
nginx:
image: nginx:alpine
container_name: '${APP_NAME}-nginx'
tty: true
ports:
- '${APP_PORT}:80'
- '${SSL_PORT}:443'
volumes:
- ./sources:/var/www
- ./docker/config/conf.d/:/etc/nginx/conf.d/
- ./docker/logs/nginx:/var/log/nginx/
- ./docker/server/certs:/var/www/certs/
- ./docker/config/nginx.conf:/etc/nginx/nginx.conf
environment:
- 'DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASS}@db_server:3306/${MYSQL_DB}'
depends_on:
- server
- db_server
networks:
- nginx
#DB service
db_server:
image: mariadb
container_name: '${APP_NAME}-db'
command: --default-authentication-plugin=mysql_native_password
restart: 'always'
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'false'
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASS}'
MYSQL_USER: '${MYSQL_USER}'
MYSQL_PASSWORD: '${MYSQL_PASS}'
MYSQL_DATABASE: '${MYSQL_DB}'
volumes:
- db_data:/var/lib/mysql
- ./docker/db/mariadb/my.cnf:/etc/mysql/conf.d/mysql.cnf
- ./docker/logs/db/query.log:/var/log/query.log
ports:
- '${DB_PORT}:3306'
healthcheck:
test: mysqladmin ping -h ${IP_DB_SERVER} -u root --password=$$MYSQL_ROOT_PASSWORD
interval: 5s
retries: 5
networks:
- nginx
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: ${APP_NAME}-phpmyadmin
restart: always
ports:
- '${PHPMYADMIN_PORT}:${APP_PORT}'
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: ${PHPMYADMIN_UPLOAD_LIMIT}
networks:
- nginx
redis:
image: redis
container_name: ${APP_NAME}-redis
hostname: redis
restart: 'on-failure'
ports:
- '${REDIS_PORT}:6379'
networks:
- nginx
volumes:
db_data: