Skip to content

Commit

Permalink
Merge branch 'development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
williamw04 committed Dec 30, 2024
2 parents 9f194fb + c9d4ca9 commit 4f58471
Show file tree
Hide file tree
Showing 42 changed files with 2,840 additions and 348 deletions.
137 changes: 78 additions & 59 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,84 @@
# *
version: "3.8"
services:
# Database service. It's PostgreSQL, see the Dockerfile in ./database
database:
build: ./containers/database/
environment:
- 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
# Uncomment the below to access PostgreSQL server from the host machine
# ports:
# - "5432:5432"

# Web service runs Node
web:
healthcheck:
test: ["CMD", "curl", "-f", "http://web:3000"]
interval: 15s
timeout: 1s
retries: 6
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
- OED_MAIL_SMTP=smtp.example.com
- OED_MAIL_SMTP_PORT=465
- [email protected]
- OED_MAIL_CREDENTIAL=credential
- [email protected]
- [email protected]
- OED_MAIL_ORG=My Organization Name
- TZ=Etc/UTC
build:
context: ./
dockerfile: ./containers/web/Dockerfile
links:
- database
volumes:
- ./:/usr/src/app
ports:
- "3000:3000"
- "9229:9229" # Debug port
depends_on:
- database
command:
[
"bash",
"./src/scripts/installOED.sh",
"${install_args:-}"
]
# 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"]

# Cypress testing service
# Cypress testing service
cypress:
image: cypress/included
profiles:
Expand All @@ -80,4 +99,4 @@ services:
entrypoint: >
/bin/sh -c "
rm -f /tmp/.X99-lock &&
Xvfb :99 -screen 0 1024x768x16"
Xvfb :99 -screen 0 1024x768x16"
Loading

0 comments on commit 4f58471

Please sign in to comment.