# This compose file is meant to spin up a copy of all supported database vendors + Redis and S3 (Minio).
# For production use see the docker compose file example in the docs:
#     https://docs.directus.io/self-hosted/installation/docker/#docker-compose
#
# ONLY FOR DEBUGGING. THIS IS NOT INTENDED FOR PRODUCTION USE.
#
# Ports:
#   Postgres:        5100
#   MySQL (8):       5101
#   MariaDB:         5102
#   MS SQL:          5103
#   Oracle:          5104
#   Redis:           5105
#   Minio (S3):      5106
#   Azure            5107
#   MySQL (5.7):     5108
#   Memcached:       5109
#   Keycloak:        5110
#   Postgres (10):   5111
#   Minio Admin:     5112
#   CockroachDB:     5113
#
# Credentials:
#   Postgres:
#     User:          postgres
#     Password:      secret
#
#   MySQL:
#     User:          root
#     Password:      secret
#
#   MariaDB:
#     User:          root
#     Password:      secret
#
#   MS SQL:
#     User:          sa
#     Password:      Test@123
#
#   Oracle DB:
#     User:          secretsysuser
#     Password:      secretpassword
#     Role:          SYSDEFAULT
#     SID:           XE
#
#   Redis:
#     n/a
#
#   Minio:
#     Key:           minioadmin
#     Secret:        minioadmin
#     (Make sure to set S3_FORCE_PATH_STYLE to true)
#
#   Azure Blob Storage
#     Name:          devstoreaccount1
#     Key:           Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
#     Container:     devstoreaccount1
#
#   Memcached
#     n/a
#
#   Keycloak
#     User:          admin
#     Password:      secret
#
#   CockroachDB
#     User:          admin
#     Password:      --

version: '3.1'
services:
  postgres:
    image: postgis/postgis:13-3.1-alpine
    environment:
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: directus
    ports:
      - 5100:5432

  mysql:
    image: mysql:8
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: directus
    ports:
      - 5101:3306
    cap_add:
      - SYS_NICE

  maria:
    image: mariadb:10.7
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: directus
    ports:
      - 5102:3306

  mssql:
    image: mcr.microsoft.com/mssql/server:2019-latest
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=Test@123
    ports:
      - 5103:1433

  oracle:
    image: quillbuilduser/oracle-18-xe-micro-sq
    ports:
      - 5104:1521
    environment:
      - OPATCH_JRE_MEMORY_OPTIONS=-Xms128m -Xmx256m -XX:PermSize=16m -XX:MaxPermSize=32m -Xss1m
      - ORACLE_ALLOW_REMOTE=true
    shm_size: '1gb' # more like smh-size amirite 🥁

  redis:
    image: redis:6-alpine
    ports:
      - 5105:6379

  minio:
    image: minio/minio:latest
    command: server /data/minio/ --console-address :9001
    ports:
      - 5106:9000
      - 5112:9001

  azure:
    image: mcr.microsoft.com/azure-storage/azurite
    ports:
      - 5107:10000

  mysql5:
    image: mysql:5
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: directus
    ports:
      - 5108:3306

  memcached:
    image: memcached:latest
    ports:
      - 5109:11211

  keycloak:
    image: jboss/keycloak:latest
    environment:
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: secret
      DB_ADDR: ''
      DB_VENDOR: h2
    ports:
      - 5110:8080

  postgres10:
    image: postgis/postgis:10-3.1-alpine
    environment:
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: directus
    ports:
      - 5111:5432

  cockroachdb:
    image: cockroachdb/cockroach:latest-v21.1
    command: start-single-node --cluster-name=example-single-node --insecure
    ports:
      - 5113:26257
