-
Notifications
You must be signed in to change notification settings - Fork 486
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·145 lines (143 loc) · 7.89 KB
/
docker-compose.yml
File metadata and controls
executable file
·145 lines (143 loc) · 7.89 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
# *
# * 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/.
# *****************************************************************
# This is the default Docker configuration file that is used for
# OED sites. Normally only places with comments indicating possible
# changes should be modified as described.
#
# OED developers should change the other docker file and start OED
# with a modified command. OED sites should NEVER do this.
# *****************************************************************
version: "3.8"
services:
# Database service. It's PostgreSQL, see the Dockerfile in ./database.
database:
environment:
# Default postgres password that should be changed for security.
# The OED install process will not allow this password and it will
# be replaced with a random, secure password if not changed here.
# That is fine as many sites do not need regular access to the
# database so a password they created is not important. OED will
# provide the password created for future use.
# If the password is changed then it is important to make it secure to
# avoid unauthorized access.
- POSTGRES_PASSWORD=pleaseChange
# Custom PGDATA per recommendations from official Docker page
- PGDATA=/var/lib/postgresql/data/pgdata
# Location of database Docker configuration and startup files.
build: ./containers/database/
volumes:
# This maps the proper Docker database directory back to the local file
# system. It is critical that the changes actually be written back to
# a non-docker file location so they will continue to exist between
# OED startups and not lost since Docker container information is reset.
- ./postgres-data:/var/lib/postgresql/data/pgdata
# Tries to make sure postgres is running properly. For example, the DB can be
# running but not ready to accept connections.
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 10s
retries: 3
# Web service runs Node
web:
# Configuration variables for the app.
environment:
# Default oed user postgres password that should be changed for security.
# The OED install process will not allow this password and it will
# be replaced with a random, secure password if not changed here.
# That is fine as many sites do not need regular access to the
# database so a password they created is not important. OED will
# provide the password created for future use.
# If the password is changed then it is important to make it secure to
# avoid unauthorized access.
- OED_DB_PASSWORD=opened
# Default web token that should be changed for security.
# The OED install process will not allow this token and it will
# be replaced with a random, secure token if not changed.
# That is fine as there is normally no usage outside of the OED app for this.
# OED will provide the token created for future use.
# If the taken is changed here then it is important to make it secure to
# avoid unauthorized access.
- OED_TOKEN_SECRET=?
# The OED_MAIL_... values are set to enable OED to send email about issues.
- 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
- OED_MAIL_IDENT=someone@example.com # The user email that is used for sending emails (SMTP)
- OED_MAIL_CREDENTIAL=credential # Set the email password for sending email here
- OED_MAIL_FROM=mydomain@example.com # The email address that the email will come from
- OED_MAIL_TO=someone@example.com # 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.
# OED_PRODUCTION should NEVER be changed here. If this is for an OED site then
# it is VERY important that it be yes for security reasons. If you are doing
# development then you should be changing the other docker file as per the help
# page for developers.
# - OED_PRODUCTION=yes
# TODO THIS VALUE IS TEMPORARILY BEING SET TO no DURING THE TRANSITION TO THE NEW SETUP WHERE
# THERE IS A SEPARATE DOCKER CONFIGURATION FILE FOR DEVELOPERS. THIS ALLOWS DEVELOPERS
# TO CONTINUE TO USE THE CURRENT COMMAND TO START UP OED. THE PLAN IS TO REMOVE THIS
# AFTER THE PHASE IN PERIOD.
- OED_PRODUCTION=no
# See the ports mapping below to change the port used on your system.
# Normally OED_SERVER_PORT is not modified.
- OED_SERVER_PORT=3000
# Normally these users are fine and there should be no reason to change the next
# three items.
- OED_DB_USER=oed
- OED_DB_DATABASE=oed
# This user is used when the standard OED testing is run. It is left in this Docker
# config file in case sites want to run the test suite.
- OED_DB_TEST_DATABASE=oed_testing
# Docker will set this hostname.
- OED_DB_HOST=database
# This is the standard postgres port. At a site this should not cause issues as it
# is only used within the Docker container.
- OED_DB_PORT=5432
# This is the file where OED log messages are stored. It is now a backup location for
# messages since all should be logged to the database and available via an OED web page.
- OED_LOG_FILE=log.txt
# 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.
# 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
# As with the DB above, this tries to ensure all is okay.
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 5
# 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",
]