<commit_before>###########################################################################
#######             FOR DEMONSTRATION PURPOSES ONLY                 #######
###########################################################################
#                                                                         #
# If you have not yet read the tutorial, do so now:                       #
#  https://ory-am.gitbooks.io/hydra/content/tutorial.html                 #
#                                                                         #
# This set up is only for demonstration purposes. The login               #
# endpoint can only be used if you follow the steps in the tutorial.      #
#                                                                         #
###########################################################################

version: '2'

services:

  hydra-migrate:
    build:
      context: .
      dockerfile: Dockerfile-alpine
    links:
      - postgresd:postgresd
    command:
      migrate sql postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable
    restart: on-failure

  hydra:
    build:
      context: .
      dockerfile: Dockerfile-alpine
    links:
      - postgresd:postgresd
#     Uncomment the following line to use mysql instead.
#      - mysqld:mysqld
    depends_on:
      - hydra-migrate
    volumes:
      - hydravolume:/root
    ports:
      - "4444:4444"
      - "4445:4445"
    command:
      host --dangerous-auto-logon --dangerous-force-http --disable-telemetry
    environment:
      - LOG_LEVEL=debug
      - ISSUER=http://localhost:4444
      - CONSENT_URL=http://localhost:3000/consent
      - DATABASE_URL=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable
#     Uncomment the following line to use mysql instead.
#      - DATABASE_URL=mysql://root:secret@tcp(mysqld:3306)/mysql?parseTime=true
      - FORCE_ROOT_CLIENT_CREDENTIALS=admin:<PASSWORD>-password
      - SYSTEM_SECRET=youReallyNeedToChangeThis
    restart: unless-stopped

  consent:
    environment:
      - HYDRA_URL=http://hydra:4444
      - HYDRA_CLIENT_ID=admin
      - HYDRA_CLIENT_SECRET=<PASSWORD>
      - NODE_TLS_REJECT_UNAUTHORIZED=0
    image: oryd/hydra-consent-app-express:v0.11.0
    links:
      - hydra
    ports:
      - "3000:3000"
    restart: unless-stopped

  postgresd:
    image: postgres:9.6
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=hydra
      - POSTGRES_PASSWORD=<PASSWORD>
      - POSTGRES_DB=hydra

#  Uncomment the following section to use mysql instead.
#  mysqld:
#    image: mysql:5.7
#    environment:
#      - MYSQL_ROOT_PASSWORD=<PASSWORD>

volumes:
  hydravolume:
    driver: local<commit_msg>docker: Adds port 4445 to docker-compose example<commit_after>###########################################################################
#######             FOR DEMONSTRATION PURPOSES ONLY                 #######
###########################################################################
#                                                                         #
# If you have not yet read the tutorial, do so now:                       #
#  https://ory-am.gitbooks.io/hydra/content/tutorial.html                 #
#                                                                         #
# This set up is only for demonstration purposes. The login               #
# endpoint can only be used if you follow the steps in the tutorial.      #
#                                                                         #
###########################################################################

version: '2'

services:

  hydra-migrate:
    build:
      context: .
      dockerfile: Dockerfile
    links:
      - postgresd:postgresd
    command:
      migrate sql postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable
    restart: on-failure

  hydra:
    build:
      context: .
      dockerfile: Dockerfile
    links:
      - postgresd:postgresd
#     Uncomment the following line to use mysql instead.
#      - mysqld:mysqld
    depends_on:
      - hydra-migrate
    ports:
      - "4444:4444"
      - "4445:4445"
    command:
      serve --dangerous-force-http
    environment:
#      - LOG_LEVEL=debug
      - OAUTH2_ISSUER_URL=http://localhost:4444
      - OAUTH2_CONSENT_URL=http://localhost:3000/consent
      - OAUTH2_LOGIN_URL=http://localhost:3000/login
      - DATABASE_URL=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable
#     Uncomment the following line to use mysql instead.
#      - DATABASE_URL=mysql://root:secret@tcp(mysqld:3306)/mysql?parseTime=true
      - SYSTEM_SECRET=youReallyNeedToChangeThis
      - OAUTH2_SHARE_ERROR_DEBUG=1
    restart: unless-stopped

  consent:
    environment:
      - HYDRA_URL=http://hydra:4444
    image: oryd/hydra-login-consent-node:latest
    links:
      - hydra
    ports:
      - "3000:3000"
    restart: unless-stopped

  postgresd:
    image: postgres:9.6
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=hydra
      - POSTGRES_PASSWORD=<PASSWORD>
      - POSTGRES_DB=hydra

#  Uncomment the following section to use mysql instead.
#  mysqld:
#    image: mysql:5.7
#    environment:
#      - MYSQL_ROOT_PASSWORD=<PASSWORD>
{'fraction_non_alphanumeric': 0.17221584385763491, 'fraction_numerical': 0.026789131266743208, 'mean_word_length': 2.0407213496218732, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3554678', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1503, 'n_words': 279}