forked from kizniche/Mycodo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (135 loc) · 4.8 KB
/
docker-compose.yml
File metadata and controls
145 lines (135 loc) · 4.8 KB
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
139
140
141
142
143
144
145
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
# ports:
# - 8086:8086
mycodoinfluxdb:
ports:
- 8086:8086
volumes:
- mycodo_influxdb:/var/lib/influxdb2
image: influxdb:latest
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=mycodo
- DOCKER_INFLUXDB_INIT_PASSWORD=mmdu77sj3nIoiajjs
- DOCKER_INFLUXDB_INIT_ORG=mycodo
- DOCKER_INFLUXDB_INIT_BUCKET=mycodo_db
mycodonginx:
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:
- mycodoflask
mycododaemon:
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
- ./bindmount/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:
- mycodoflask
mycodoflask:
container_name: mycodo_flask
image: app
hostname: mycodohost # 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:
- mycodoinfluxdb
# 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: