-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
138 lines (131 loc) · 4.03 KB
/
docker-compose.prod.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: "3.8"
services:
webserver:
image: traefik:v2.5
restart: 'no'
command:
- --experimental.http3=true
- --log.level=DEBUG
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entryPoint.to=ssl
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.web.http.redirections.entryPoint.permanent=true
- --entrypoints.ssl.address=:443
- --certificatesresolvers.acme.acme.email=admin@${DOMAIN}
- --certificatesresolvers.acme.acme.storage=/service-state/acme.json
- --certificatesresolvers.acme.acme.httpchallenge.entrypoint=web
- --certificatesresolvers.acme.acme.caserver=https://acme-v02.api.letsencrypt.org/directory
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- .docker/data/traefik/:/service-state/
ports:
- ${WEB_PORT:-80}:80
- 443:443
links:
- php
- grafana
php:
image: viktorprogger/yii-inform:latest
volumes:
- ./runtime/ssl:/var/www/runtime/ssl
- logs:/var/www/runtime/logs
- logs-rr:/var/www/runtime/logs-rr
command:
- vendor/bin/wait-for-it.sh
- db:3306
- --strict
- --
- vendor/bin/wait-for-it.sh
- amqp:5672
- --strict
- --
- ./rr
- serve
- -c
- .rr.prod.yaml
- -o
- http.pool.num_workers=${RR_WORKERS}
#- -o
#- http.ssl.acme.domains=${DOMAIN}
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
environment:
TZ: Europe/Moscow
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_LOGIN: ${DB_LOGIN}
GITHUB_TOKEN: ${GITHUB_TOKEN}
YII_DEBUG: 'false'
YII_ENV: ${YII_ENV:-prod}
XDEBUG_MODE: 'off'
URL_PREFIX: /app
DOMAIN: ${DOMAIN}
env_file:
- .env
depends_on:
- db
- amqp
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(\"${DOMAIN}\") && Path(`/app`, `/app/{path:.*}`)"
- "traefik.http.routers.app.entrypoints=ssl"
- "traefik.http.routers.app.tls=true"
- "traefik.http.routers.app.tls.certresolver=acme"
- "traefik.http.services.app.loadbalancer.server.port=80"
db:
image: mysql:5.7
restart: unless-stopped
volumes:
- .docker/data/db:/var/lib/mysql
ports:
- "127.0.0.1:${DB_PORT:-3306}:3306"
environment:
TZ: Europe/Moscow
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_LOGIN}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
amqp:
image: rabbitmq:3-management
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: ${AMQP_USER}
RABBITMQ_DEFAULT_PASS: ${AMQP_PASSWORD}
expose:
- 5672
loki:
image: grafana/loki:2.4.1
command: -config.file=/etc/loki/local-config.yaml
promtail:
image: grafana/promtail:2.4.1
volumes:
- logs:/var/log/app:ro
- logs-rr:/var/log/rr:ro
- .docker/data/promtail-data:/var/lib/promtail/positions
- .docker/loki/promtail-local-config.yml:/etc/promtail/config.yml
command: -config.file=/etc/promtail/config.yml
links:
- loki
grafana:
image: grafana/grafana-oss:latest
user: 1000:1000
volumes:
- .docker/data/grafana:/var/lib/grafana
- .docker/grafana/provisioning:/etc/grafana/provisioning
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-yii-inform}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
GF_SERVER_ROOT_URL: https://${DOMAIN}/grafana
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(\"${DOMAIN}\") && Path(`/grafana`, `/grafana/{path:.*}`)"
- "traefik.http.routers.grafana.entrypoints=ssl"
- "traefik.http.routers.grafana.tls=true"
- "traefik.http.routers.grafana.tls.certresolver=acme"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
volumes:
logs:
logs-rr: