-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlnmp
49 lines (46 loc) · 1.26 KB
/
lnmp
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
version: "2"
services:
mysql:
image: mysql:8.0.13
restart: always
command: mysqld --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --init_connect='SET collation_connection = utf8_unicode_ci' --init-connect='SET NAMES UTF8MB4;' --sql-mode="NO_ENGINE_SUBSTITUTION" --innodb-flush-log-at-trx-commit=0
env_file:
- .env
container_name: ${MYSQL_CONTAINER_NAME}
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- TZ=Asia/Shanghai
volumes:
- ${MYSQL_DATA_DIR}:/var/lib/mysql
ports:
- ${MYSQL_PORT}:3306
nginx:
image: nginx:1.15.11-alpine
container_name: ${NGINX_CONTAINER_NAME}
privileged: true
restart: always
env_file:
- .env
user: root
depends_on:
- php-zixun
- mysql
links:
- php-zixun
ports:
- ${NGINX_PORT}:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ../src:/var/www/src
command: [nginx, '-g', 'daemon off;']
php-zixun:
build: .
env_file:
- .env
container_name: ${PHP_CONTAINER_NAME}
restart: always
volumes:
- ../src:/var/www/src