<commit_before># *
# * 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: "2.1"
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 can be changed for security.
        volumes:
            - ./postgres-data:/var/lib/postgresql/data/pgdata
        # healthcheck:
            # This checks if postgres is ready for work.
            # test: ["CMD-SHELL", "pg_isready -U postgres"]
            # interval: 5s
            # timeout: 5s
            # retries: 5
    # 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 "gmail", "mailgun", "none". Case insensitive.
            - OED_MAIL_IDENT=<EMAIL>
            - OED_MAIL_CREDENTIAL=credential # Set the email password here
            - OED_MAIL_FROM=<EMAIL>
            - OED_MAIL_TO=<EMAIL>  # Set the destination address here
            - OED_MAIL_ORG=My Organization Name # Org name for mail formatting
            # 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"
            - "9229:9229" # Debug port
              # For production you might want something like:
              # - "80:3000"
              # and disable the debug port
        # 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
        command: ["bash", "./src/scripts/installOED.sh", "${install_args}"]
        # Reverse proxy, for testing<commit_msg>Fixes warning if install_args not set.<commit_after># *
# * 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: "2.1"
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 can be changed for security.
        volumes:
            - ./postgres-data:/var/lib/postgresql/data/pgdata
        # healthcheck:
            # This checks if postgres is ready for work.
            # test: ["CMD-SHELL", "pg_isready -U postgres"]
            # interval: 5s
            # timeout: 5s
            # retries: 5
    # 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 "gmail", "mailgun", "none". Case insensitive.
            - OED_MAIL_IDENT=<EMAIL>
            - OED_MAIL_CREDENTIAL=credential # Set the email password here
            - OED_MAIL_FROM=<EMAIL>
            - OED_MAIL_TO=<EMAIL>  # Set the destination address here
            - OED_MAIL_ORG=My Organization Name # Org name for mail formatting
            # 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"
            - "9229:9229" # Debug port
              # For production you might want something like:
              # - "80:3000"
              # and disable the debug port
        # 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 the it becomes blank without warning user.
        command: ["bash", "./src/scripts/installOED.sh", "${install_args:-}"]
        # Reverse proxy, for testing
{'fraction_non_alphanumeric': 0.07931034482758621, 'fraction_numerical': 0.012807881773399015, 'mean_word_length': 1.7191964285714285, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3696745', 'n_tokens_mistral': 1774, 'n_tokens_neox': 1693, 'n_words': 534}