-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
113 lines (113 loc) · 2.71 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
version: "3.8"
services:
web-server:
build:
context: .
dockerfile: Dockerfile
container_name: web
volumes:
- ./project:/var/www/html
- ./nginx:/etc/nginx/conf.d
- ./php:/usr/local/etc/php/conf.d
- ./php-fpm:/usr/local/etc/php-fpm.d
- ./supervisor:/etc/supervisor/conf.d
- ./logs/nginx:/var/log/nginx
- ./logs/php:/var/log/php
- ./logs/supervisor/:/var/log/supervisor
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:80" ]
interval: 2s
timeout: 3s
retries: 3
start_period: 40s
depends_on:
- mysql-server
- redis-server
networks:
- backend
- frontend
ports:
- '80:80'
- '443:443'
acme.sh:
image: neilpang/acme.sh
container_name: acme.sh
restart: always
command: daemon
volumes:
- ./acmeout:/acme.sh
- ./project/ssl:/acme.sh/ssl
environment:
- Ali_Key=LTAI4LOIJKLiFLhfrzb9
- Ali_Secret=jKvIWLHYIKe4UHUW754
networks:
- backend
- frontend
redis-server:
image: redis:latest
container_name: redis
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 1s
timeout: 3s
retries: 30
volumes:
- ./redis:/usr/local/etc/redis
networks:
- backend
depends_on:
- mysql-server
mysql-server:
image: mysql:5.7
container_name: mysql
ports:
- '3306:3306'
restart: always
healthcheck:
test: [ "CMD", "mysqladmin", "ping","-h","localhost" ]
interval: 1s
timeout: 3s
retries: 30
volumes:
- ./mysql/init:/docker-entrypoint-initdb.d
- ./mysql/data:/var/lib/mysql
- ./logs/mysql:/data/mysql/logs
- ./mysql/conf:/etc/mysql/conf.d
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --explicit_defaults_for_timestamp=true
- --innodb-use-native-aio=0
- --default-authentication-plugin=mysql_native_password
- --max_connections=1000
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_db_root
secrets:
- mysql_db_root
networks:
- backend
adminer-server:
image: adminer:latest
container_name: adminer
restart: always
depends_on:
- mysql-server
healthcheck:
test: [ "CMD", "php", "-r", "echo file_get_contents('http://localhost:8080');" ]
interval: 30s
timeout: 3s
retries: 3
start_period: 40s
environment:
ADMINER_DEFAULT_SERVER: mysql
ports:
- '8080:8080'
networks:
- backend
networks:
backend:
frontend:
secrets:
mysql_db_root:
file: ./mysql/mysqlroot.txt