-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.prod.yml
98 lines (98 loc) · 3.86 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
---
version: '3'
# This docker compose file makes a few changes that make developing easier.
# Docker will automatically layer this over the docker-compose.yml base file
#
# The changes are
# - the addition of a node server that auto recompiles the front end
# - Pulling in the nginx config from outside and using the develop instead of the production file
services:
host-server:
restart: unless-stopped
env_file:
- ./flo_web/datadog.env
environment:
- DD_SERVICE=flosystem_host-server
labels:
com.datadoghq.ad.logs: '[{"source": "nodejs", "service": "flosystem_host-server",
"type": "file", "path": "/usr/logs/datadog.log", "sourcecategory": "sourcecode"}]'
operator-server:
restart: unless-stopped
env_file:
- ./flo_web/datadog.env
environment:
- DD_SERVICE=flosystem_operator-server
labels:
com.datadoghq.ad.logs: '[{"source": "nodejs", "service": "flosystem_operator-server",
"type": "file", "path": "/usr/logs/datadog.log", "sourcecategory": "sourcecode"}]'
nginx:
restart: unless-stopped
volumes:
- ./certs/certbot/conf:/etc/letsencrypt
- ./certs/certbot/www:/var/www/certbot
labels:
com.datadoghq.ad.check_names: '["nginx"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"nginx_status_url": "http://%%host%%:81/nginx_status/"}]'
com.datadoghq.ad.logs: '[{"source": "nginx", "service": "flosystem_nginx"}]'
command: /bin/sh -c 'while :; do sleep $$(( $$( date -d "next sunday 0700" +%s
) - $$( date +%s ) )) & wait $${!}; nginx -s reload; done & nginx -g "daemon
off;"'
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./certs/certbot/conf:/etc/letsencrypt
- ./certs/certbot/www:/var/www/certbot
entrypoint: /bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 48h &
wait $${!}; done;'
# ^ would use something better, but the container has busybox for its interpreter
postgres:
restart: unless-stopped
labels:
com.datadoghq.ad.check_names: '["postgres"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"host": "%%host%%","port": 5432,"username": "datadog","dbname":
"flodb","password": "not-so-secret"}]'
com.datadoghq.ad.logs: '[{"source": "postgresql", "service": "flosystem_postgres"}]'
volumes:
- $HOME/docker/volumes/postgres:/var/lib/postgresql/data
session-store:
restart: unless-stopped
labels:
com.datadoghq.ad.check_names: '["redisdb"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"host": "%%host%%", "port": "6379"}]'
com.datadoghq.ad.logs: '[{"source": "redis", "service": "flosystem_session-store"}]'
client-store:
restart: unless-stopped
labels:
com.datadoghq.ad.check_names: '["redisdb"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"host": "%%host%%", "port": "6379"}]'
com.datadoghq.ad.logs: '[{"source": "redis", "service": "flosystem_client-store"}]'
api-server:
env_file:
- ./certs/coturn.env
- ./flo_web/datadog.env
environment:
- DD_SERVICE=flosystem_api-server
labels:
com.datadoghq.ad.logs: '[{"source": "nodejs", "service": "flosystem_api-server",
"type": "file", "path": "/usr/logs/datadog.log", "sourcecategory": "sourcecode"}]'
datadog:
restart: unless-stopped
image: datadog/agent
env_file:
- ./certs/datadog.env
environment:
- DD_APM_ENABLED=true
- DD_APM_NON_LOCAL_TRAFFIC=true
- DD_LOGS_ENABLED=true
- DD_AC_EXCLUDE=image:datadog/agent
- DD_PROCESS_AGENT_ENABLED=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
- /opt/datadog-agent/run:/opt/datadog-agent/run:rw