-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
116 lines (111 loc) · 2.49 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
114
115
116
version: '3.6'
services:
traefik:
image: traefik
ports:
- 80:80
- 443:443
# - 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /data/traefik/traefik.toml:/etc/traefik/traefik.toml
# - /data/traefik/acme.json:/etc/traefik/acme/acme.json
- /data/certs/:/certs/
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.port=8080"
- "traefik.frontend.rule=Host:lb.deved"
- "traefik.docker.network=proxy"
- "traefik.enable=true"
- "traefik.frontend.headers.SSLRedirect=true"
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
networks:
- proxy
web:
image: nginx:latest
volumes:
- sshvhost:/etc/nginx/conf.d/
- sshproject:/var/www/html
- logs-web:/var/log/nginx
depends_on:
- php
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.port=80"
- "traefik.frontend.rule=Host:api.deved"
- "traefik.docker.network=proxy"
- "traefik.enable=true"
- "traefik.frontend.passHostHeader=true"
- "traefik.frontend.headers.SSLRedirect=true"
restart_policy:
condition: on-failure
networks:
- internal
- proxy
php:
image: edu/php7.1-fpm
volumes:
- sshproject:/var/www/html
- logs-php-fpm:/var/log/php-fpm
depends_on:
- postgres
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.enable=false"
restart_policy:
condition: on-failure
networks:
- internal
postgres:
image: postgres:9.5
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: 123
POSTGRES_USER: admin
volumes:
- pg-data:/var/lib/postgresql/data
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.enable=false"
restart_policy:
condition: on-failure
networks:
- internal
volumes:
logs-php-fpm:
logs-web:
pg-data:
sshproject:
driver: vieux/sshfs
driver_opts:
sshcmd: [email protected]:/data/html
password: tcuser
allow_other: ""
sshvhost:
driver: vieux/sshfs
driver_opts:
sshcmd: [email protected]:/data/vhost
password: tcuser
allow_other: ""
networks:
proxy:
external: true
name: proxy
internal:
name: internal