-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
83 lines (79 loc) · 2.18 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
# Base docker compose, added to by docker-compose.override or docker-compose.prod. See Readme.md
version: '2'
services:
# PHP & apache container using offical Docker PHP iamge
web:
build: .
links:
- db
ports:
# Expose Emoncms on localhost port 8080
- 8080:80
volumes:
# Mount emoncms files from local FS for dev
- ./www:/var/www/heatpumpmonitororg
env_file:
# Use default enviroment variables file for dev
- 'default.docker-env'
depends_on:
load_dev_env_data:
condition: service_completed_successfully
# This container will load the data (if requested) and then stop
load_dev_env_data:
build: .
links:
- db
volumes:
# Mount emoncms files from local FS for dev
- ./www:/var/www/heatpumpmonitororg
env_file:
# Use default enviroment variables file for dev
- 'default.docker-env'
environment:
# Clear database before loading data
- "RELOAD_ALL=0"
# Load the users
- "LOAD_USERS=1"
# Load system meta data
- "LOAD_SYSTEM_META=1"
# Loading running stats is enough to provide the list of systems
- "LOAD_RUNNING_STATS=1"
# Use only when required, this is slow and uses server bandwidth
- "LOAD_MONTHLY_STATS=0"
# Use only when required, this is even slower and uses server bandwidth
- "LOAD_DAILY_STATS=0"
# working_dir: /var/www/heatpumpmonitororg # Set the working directory
entrypoint: "php /var/load_dev_env_data.php"
depends_on:
db:
condition: service_healthy
db:
image: mariadb:11.0
environment:
- "MYSQL_HOST=localhost"
- "MARIADB_AUTO_UPGRADE=1"
- "MARIADB_INITDB_SKIP_TZINFO=1"
env_file:
- 'default.docker-env'
volumes:
- emon-db-data:/var/lib/mysql
logging:
driver: json-file
options:
max-size: "10m"
healthcheck:
test:
[
"CMD",
"/usr/local/bin/healthcheck.sh",
"--su-mysql",
"--connect",
"--innodb_initialized"
]
interval: 1s
start_period: 60s
timeout: 2s
retries: 10
volumes:
emon-db-data:
driver: local