forked from OpenEnergyDashboard/OED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
84 lines (83 loc) · 3.94 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
# *
# * This Source Code Form is subject to the terms of the Mozilla Public
# * License, v. 2.0. If a copy of the MPL was not distributed with this
# * file, You can obtain one at http://mozilla.org/MPL/2.0/.
# *
version: "3.8"
services:
# Database service. It's PostgreSQL, see the
# Dockerfile in ./database
database:
build: ./containers/database/
environment:
# Custom PGDATA per recommendations from official Docker page
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=pleaseChange # default postgres password that should be changed for security.
volumes:
- ./postgres-data:/var/lib/postgresql/data/pgdata
# ports:
# - "5432:5432"
# Uncomment the above lines to enable access to the PostgreSQL server
# from the host machine.
# Web service runs Node
web:
# Configuration variables for the app.
environment:
- OED_PRODUCTION=no
- OED_SERVER_PORT=3000
- OED_DB_USER=oed
- OED_DB_DATABASE=oed
- OED_DB_TEST_DATABASE=oed_testing
- OED_DB_PASSWORD=opened
- OED_DB_HOST=database # Docker will set this hostname
- OED_DB_PORT=5432
- OED_TOKEN_SECRET=?
- OED_LOG_FILE=log.txt
- OED_MAIL_METHOD=none # Method of sending mail. Supports "secure-smtp", "none". Case insensitive.
- OED_MAIL_SMTP=smtp.example.com # Edit this
- OED_MAIL_SMTP_PORT=465 # Edit this
- [email protected] # The user email that is used for sending emails (SMTP)
- OED_MAIL_CREDENTIAL=credential # Set the email password for sending email here
- [email protected] # The email address that the email will come from
- [email protected] # Set the destination address here for where to send emails
- OED_MAIL_ORG=My Organization Name # Org name for mail that is included in the subject
# Changing this value does not impact what OED displays.
# What it will change is the date/time stamp on logs, notes and change dates that place the current date/time.
# It can also impact the interpretation of readings sent to OED such as Unix timestamps.
- TZ=Etc/UTC # Set the timezone of the Docker container where OED runs the web services.
# If in a subdirectory, set it here
# - OED_SUBDIR=/subdir/
# Set the correct build environment.
build:
context: ./
dockerfile: ./containers/web/Dockerfile
# Link to the database so the app can persist data
links:
- database
# Load the source code into the container.
# Using a volume allows autorebuild to work.
volumes:
- ./:/usr/src/app
# Map the default port.
ports:
- "3000:3000" # Should be commented out if you uncomment 80:3000 below.
- "9229:9229" # Debug port, should be commented out for production
# For production you might want something like:
# - "80:3000"
# and comment out the debug port and 3000:3000 line above
# Don't bring this up without the DB
depends_on:
- database
# database:
# We need the database and it has to be ready for work (see healthcheck above).
# condition: service_healthy
# Lets docker-compose up work right
# If environment variable install_args is not set then it becomes blank without warning user.
command:
[
"bash",
"./src/scripts/installOED.sh",
"${install_args:-}"
]
# Use this if you are using a docker-compose that is earlier than version 2 and comment out the one above.
# command: ["bash", "./src/scripts/installOED.sh"]