forked from kizniche/Mycodo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
130 lines (121 loc) · 4.37 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3.7"
services:
mycodo_influxdb:
container_name: mycodo_influxdb
build:
context: ./
dockerfile: docker/influxdb/Dockerfile
env_file:
- 'docker/influxdb/env.influxdb'
volumes:
- mycodo_influxdb:/var/lib/influxdb
mycodo_nginx:
container_name: mycodo_nginx
restart: always
build:
context: ./
dockerfile: docker/nginx/Dockerfile
volumes:
- mycodo:/usr/local/mycodo
- mycodo_log:/var/log/mycodo
- mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs
ports:
- 80:80
- 443:443
depends_on:
- mycodo_flask
mycodo_daemon:
container_name: mycodo_daemon
image: app
restart: always
environment:
- TZ=America/New_York # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid time zones
volumes:
- mycodo:/usr/local/mycodo
- mycodo_env:/home/mycodo/env
- mycodo_databases:/home/mycodo/databases
- mycodo_cameras:/home/mycodo/cameras
- mycodo_custom_functions:/home/mycodo/mycodo/functions/custom_functions
- mycodo_custom_actions:/home/mycodo/mycodo/actions/custom_actions
- mycodo_custom_inputs:/home/mycodo/mycodo/inputs/custom_inputs
- mycodo_custom_outputs:/home/mycodo/mycodo/outputs/custom_outputs
- mycodo_custom_widgets:/home/mycodo/mycodo/widgets/custom_widgets
- mycodo_custom_user_scripts:/home/mycodo/mycodo/user_scripts
- mycodo_log:/var/log/mycodo
- mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs
- /dev:/dev
- /sys:/sys
- /opt:/opt
privileged: true
command: bash -c "wget --quiet --no-check-certificate -p http://mycodo_nginx/ -O /dev/null &&
PYTHONPATH=/home/mycodo /home/mycodo/env/bin/python mycodo_daemon.py"
depends_on:
- mycodo_flask
mycodo_flask:
container_name: mycodo_flask
image: app
hostname: Mycodo # Change to your desired hostname
build:
context: ./
dockerfile: docker/Dockerfile
restart: always
environment:
- TZ=America/New_York # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid time zones
volumes:
- mycodo:/usr/local/mycodo
- mycodo_env:/home/mycodo/env
- mycodo_databases:/home/mycodo/databases
- mycodo_cameras:/home/mycodo/cameras
- mycodo_custom_functions:/home/mycodo/mycodo/functions/custom_functions
- mycodo_custom_actions:/home/mycodo/mycodo/actions/custom_actions
- mycodo_custom_inputs:/home/mycodo/mycodo/inputs/custom_inputs
- mycodo_custom_outputs:/home/mycodo/mycodo/outputs/custom_outputs
- mycodo_custom_widgets:/home/mycodo/mycodo/widgets/custom_widgets
- mycodo_custom_user_scripts:/home/mycodo/mycodo/user_scripts
- mycodo_custom_user_css:/home/mycodo/mycodo/mycodo_flask/static/css/user_css
- mycodo_custom_user_js:/home/mycodo/mycodo/mycodo_flask/static/js/user_js
- mycodo_log:/var/log/mycodo
- mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs
- mycodo_influxdb:/var/lib/influxdb
- /dev:/dev
- /var/run/docker.sock:/var/run/docker.sock:ro # Permits container to restart itself
privileged: true
command: /home/mycodo/env/bin/python -m gunicorn --workers 1 --bind unix:/usr/local/mycodo/mycodoflask.sock start_flask_ui:app
depends_on:
- mycodo_influxdb
# Uncomment the following blocks and rebuild to enable Grafana and/or Telegraf
# mycodo_telegraf:
# image: telegraf:latest
# container_name: mycodo_telegraf
# volumes:
# - ./docker/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
# depends_on:
# - mycodo_influxdb
# mycodo_grafana:
# image: grafana/grafana:latest
# container_name: mycodo_grafana
# env_file:
# - './docker/grafana/env.grafana'
# volumes:
# - mycodo_grafana:/var/lib/grafana
# ports:
# - 3000:3000
# depends_on:
# - mycodo_influxdb
volumes:
mycodo:
mycodo_env:
mycodo_cameras:
mycodo_custom_functions:
mycodo_custom_actions:
mycodo_custom_inputs:
mycodo_custom_outputs:
mycodo_custom_widgets:
mycodo_custom_user_scripts:
mycodo_custom_user_css:
mycodo_custom_user_js:
mycodo_databases:
mycodo_ssl_certs:
mycodo_log:
mycodo_influxdb:
mycodo_grafana: