279 lines
11 KiB
YAML
279 lines
11 KiB
YAML
services:
|
|
express:
|
|
build: express
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
- opensearch
|
|
- maildev
|
|
environment:
|
|
NODE_ENV: development
|
|
DEBUG: termPortal:*
|
|
IS_BEHIND_PROXY: "${EXPRESS_IS_BEHIND_PROXY:?}"
|
|
SECRET: "${EXPRESS_SECRET:?}"
|
|
COOKIES_SECURE: "false"
|
|
PGHOST: postgres
|
|
PGUSER: express
|
|
PGPASSWORD: "${POSTGRES_EXPRESS_PASSWORD:?}"
|
|
PGDATABASE: term_portal
|
|
SMTP_HOST: "${SMTP_HOST:?}"
|
|
SMTP_PORT: "${SMTP_PORT:?}"
|
|
SMTP_USER: "${SMTP_USER?}"
|
|
SMTP_PASSWORD: "${SMTP_PASSWORD?}"
|
|
SMTP_SECURE: "${SMTP_SECURE:?}"
|
|
SMTP_REQUIRE_TLS: "${SMTP_REQUIRE_TLS:?}"
|
|
SMTP_TLS_ALLOW_INVALID_CERTS: "${SMTP_TLS_ALLOW_INVALID_CERTS:?}"
|
|
SMTP_FROM: "${SMTP_FROM:?}"
|
|
ORIGIN: http://localhost:${EXPRESS_LISTEN_PORT:?}
|
|
PORTAL_ADMIN_INITIAL_EMAIL: "${PORTAL_ADMIN_INITIAL_EMAIL:?}"
|
|
PORTAL_ADMIN_INITIAL_PASSWORD: "${PORTAL_ADMIN_INITIAL_PASSWORD:?}"
|
|
EXTRACTION_API_ORIGIN: "${EXTRACTION_API_ORIGIN:?}"
|
|
# OIDC/SSO (University of Ljubljana stand-in). Values point express at the throwaway dev
|
|
# Authentik instance (started separately via `--profile develop-idp`) using the SAME
|
|
# underlying AUTHENTIK_OIDC_CLIENT_ID/_SECRET already baked into its blueprint - see
|
|
# dev/authentik/README.md. If that profile isn't running, SSO login simply fails
|
|
# gracefully when clicked (see express/middleware/auth.js) - it does not affect the rest
|
|
# of the app or block startup.
|
|
OIDC_UNI_LJ_CLIENT_ID: "${AUTHENTIK_OIDC_CLIENT_ID:?}"
|
|
OIDC_UNI_LJ_CLIENT_SECRET: "${AUTHENTIK_OIDC_CLIENT_SECRET:?}"
|
|
OIDC_UNI_LJ_DISCOVERY_URL: "http://authentik-server:9000/application/o/uni-lj-test/.well-known/openid-configuration"
|
|
OIDC_UNI_LJ_AUTHORIZATION_EXTERNAL_ORIGIN: "http://localhost:${AUTHENTIK_LISTEN_PORT:?}"
|
|
volumes:
|
|
# When developing/debugging concordancer, disable express bind mount and node_modules volume and enable express-data.
|
|
# - express-data:/usr/src/app/data_files
|
|
- ./express:/usr/src/app
|
|
- /usr/src/app/node_modules
|
|
ports:
|
|
- "127.0.0.1:${EXPRESS_LISTEN_PORT:?}:3000"
|
|
- "127.0.0.1:9229:9229"
|
|
# Enabling TTY makes the npm module "debug" output display properly in container logs
|
|
tty: true
|
|
|
|
postgres:
|
|
image: postgres:15.1-alpine3.17
|
|
# Use any of the two custom Dockerfiles below for debugging PL/pgSQL functions.
|
|
# Disable docker-entrypoint-initdb.d bind mount when doing so.
|
|
# build:
|
|
# context: postgres
|
|
# dockerfile: Dockerfile.debug.alpine
|
|
# # dockerfile: Dockerfile.debug.debian
|
|
environment:
|
|
POSTGRES_PASSWORD: "${POSTGRES_ADMIN_PASSWORD:?}"
|
|
POSTGRES_DB: term_portal
|
|
POSTGRES_EXPRESS_PASSWORD: "${POSTGRES_EXPRESS_PASSWORD:?}"
|
|
POSTGRES_CONCORDANCER_PASSWORD: "${POSTGRES_CONCORDANCER_PASSWORD:?}"
|
|
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=sl-SI"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./postgres/init:/docker-entrypoint-initdb.d
|
|
ports:
|
|
- "127.0.0.1:${POSTGRES_LISTEN_PORT:?}:5432"
|
|
|
|
redis:
|
|
image: redis:6-alpine
|
|
volumes:
|
|
- redis-data:/data
|
|
- ./redis/conf:/usr/local/etc/redis
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
|
|
opensearch:
|
|
build: opensearch
|
|
environment:
|
|
cluster.name: term-portal
|
|
node.name: node-1
|
|
# bootstrap.memory_lock: "true" # along with the memlock settings below, disables swapping
|
|
# OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
|
|
DISABLE_INSTALL_DEMO_CONFIG: "true" # disables execution of install_demo_configuration.sh bundled with security plugin, which installs demo certificates and security configurations to OpenSearch
|
|
DISABLE_SECURITY_PLUGIN: "true" # disables security plugin entirely in OpenSearch by setting plugins.security.disabled: true in opensearch.yml
|
|
discovery.type: single-node # disables bootstrap checks that are enabled when network.host is set to a non-loopback address
|
|
# ulimits:
|
|
# memlock:
|
|
# soft: -1
|
|
# hard: -1
|
|
# nofile:
|
|
# soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
|
|
# hard: 65536
|
|
volumes:
|
|
- opensearch-data:/usr/share/opensearch/data
|
|
|
|
# Disabled by default. Enable if needed.
|
|
opensearch-dashboards:
|
|
image: opensearchproject/opensearch-dashboards:2.3.0
|
|
profiles:
|
|
- debug-opensearch
|
|
depends_on:
|
|
- opensearch
|
|
environment:
|
|
- 'OPENSEARCH_HOSTS=["http://opensearch:9200"]'
|
|
- "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards
|
|
ports:
|
|
- "127.0.0.1:${OS_DASHBOARDS_LISTEN_PORT:?}:5601"
|
|
|
|
concordancer:
|
|
# image: gitea.cjvt.si/rrejc/rsdo-concordancer-api:v1.1.1
|
|
build: concordancer
|
|
profiles:
|
|
- develop-concordancer
|
|
depends_on:
|
|
- postgres
|
|
- opensearch
|
|
restart: always
|
|
environment:
|
|
- "RSDO:Database:MasterConnectionString=Host=postgres;Username=concordancer;Password=${POSTGRES_CONCORDANCER_PASSWORD:?};Database=Concordancer"
|
|
- "RSDO:Elastic:ConnectionString=http://opensearch:9200"
|
|
- "RSDO:Tokenizer:ClasslaUrl=https://orodja.cjvt.si/oznacevalnik/ajax_api/v1/slv/process"
|
|
ports:
|
|
- "127.0.0.1:${CONCORDANCER_LISTEN_PORT:?}:5000"
|
|
volumes:
|
|
- express-data:/data
|
|
- sloleks:/sloleks
|
|
|
|
concordancer-manager:
|
|
image: gitea.cjvt.si/rrejc/rsdo-concordancer-systemmanager:v1.1.1
|
|
profiles:
|
|
- develop-concordancer
|
|
depends_on:
|
|
- postgres
|
|
- opensearch
|
|
restart: always
|
|
environment:
|
|
- "RSDO:Database:MasterConnectionString=Host=postgres;Username=concordancer;Password=${POSTGRES_CONCORDANCER_PASSWORD:?};Database=Concordancer"
|
|
- "RSDO:Elastic:ConnectionString=http://opensearch:9200"
|
|
volumes:
|
|
- sloleks:/sloleks
|
|
|
|
# Disabled by default. Enable for scheduled task testing.
|
|
# Manual testing can be done by running tasks inside express container directly.
|
|
# cron:
|
|
# build: express
|
|
# init: true
|
|
# depends_on:
|
|
# - postgres
|
|
# - redis
|
|
# - opensearch
|
|
# - maildev
|
|
# environment:
|
|
# NODE_ENV: development
|
|
# DEBUG: termPortal:*
|
|
# PGHOST: postgres
|
|
# PGUSER: express
|
|
# PGPASSWORD: "${POSTGRES_EXPRESS_PASSWORD:?}"
|
|
# PGDATABASE: term_portal
|
|
# SMTP_HOST: "${SMTP_HOST:?}"
|
|
# SMTP_PORT: "${SMTP_PORT:?}"
|
|
# SMTP_USER: "${SMTP_USER?}"
|
|
# SMTP_PASSWORD: "${SMTP_PASSWORD?}"
|
|
# SMTP_SECURE: "${SMTP_SECURE:?}"
|
|
# SMTP_REQUIRE_TLS: "${SMTP_REQUIRE_TLS:?}"
|
|
# SMTP_TLS_ALLOW_INVALID_CERTS: "${SMTP_TLS_ALLOW_INVALID_CERTS:?}"
|
|
# SMTP_FROM: "${SMTP_FROM:?}"
|
|
# volumes:
|
|
# - /usr/src/app/node_modules
|
|
# - /usr/src/app/scheduled
|
|
# - ./express:/usr/src/app
|
|
# # Enabling TTY makes the npm module "debug" output display properly in container logs
|
|
# tty: true
|
|
# entrypoint: ["scheduled/entrypoint.sh"]
|
|
# command: ["crond", "-f", "-l", "2"]
|
|
|
|
maildev:
|
|
image: maildev/maildev:2.0.0-beta3
|
|
volumes:
|
|
- maildev-data:/var/lib/maildev
|
|
ports:
|
|
- "127.0.0.1:${MAILDEV_WEB_GUI_PORT:?}:1080"
|
|
|
|
# Disabled by default. Enable with `--profile develop-idp` for local SSO/OIDC login testing
|
|
# against a throwaway Authentik instance. It stands in for the single real University of
|
|
# Ljubljana OIDC federation this portal will integrate with (the `auth_provider` enum's
|
|
# 'uni_lj' value) - it is NOT itself a production identity provider. See
|
|
# dev/authentik/README.md.
|
|
#
|
|
# As of authentik 2025.10+, Redis is no longer required (caching/tasks moved to Postgres), so
|
|
# this only needs its own dedicated Postgres, kept fully separate from the portal's own DB.
|
|
authentik-postgres:
|
|
image: postgres:16.14-alpine3.24
|
|
profiles:
|
|
- develop-idp
|
|
environment:
|
|
POSTGRES_DB: authentik
|
|
POSTGRES_USER: authentik
|
|
POSTGRES_PASSWORD: "${AUTHENTIK_POSTGRES_PASSWORD:?}"
|
|
volumes:
|
|
- authentik-postgres-data:/var/lib/postgresql/data
|
|
# Needed so authentik-server/authentik-worker's `depends_on: condition: service_healthy`
|
|
# actually waits for Postgres to accept connections, not just for the container to start.
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d authentik -U authentik"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
|
|
authentik-server:
|
|
image: ghcr.io/goauthentik/server:2026.8.0
|
|
command: server
|
|
profiles:
|
|
- develop-idp
|
|
depends_on:
|
|
authentik-postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
AUTHENTIK_SECRET_KEY: "${AUTHENTIK_SECRET_KEY:?}"
|
|
AUTHENTIK_POSTGRESQL__HOST: authentik-postgres
|
|
AUTHENTIK_POSTGRESQL__NAME: authentik
|
|
AUTHENTIK_POSTGRESQL__USER: authentik
|
|
AUTHENTIK_POSTGRESQL__PASSWORD: "${AUTHENTIK_POSTGRES_PASSWORD:?}"
|
|
# Non-interactively creates/updates the built-in "akadmin" superuser on first startup.
|
|
AUTHENTIK_BOOTSTRAP_EMAIL: "${AUTHENTIK_BOOTSTRAP_EMAIL:?}"
|
|
AUTHENTIK_BOOTSTRAP_PASSWORD: "${AUTHENTIK_BOOTSTRAP_PASSWORD:?}"
|
|
AUTHENTIK_BOOTSTRAP_TOKEN: "${AUTHENTIK_BOOTSTRAP_TOKEN:?}"
|
|
# Read by the custom blueprint below (via !Env) to build the test app's redirect URI as
|
|
# http://localhost:<port>/users/oidc/callback, matching the express service's own port.
|
|
IDP_REDIRECT_PORT: "${EXPRESS_LISTEN_PORT:?}"
|
|
# Fixed, non-secret dev-only OIDC client credentials for the single seeded test application.
|
|
AUTHENTIK_OIDC_CLIENT_ID: "${AUTHENTIK_OIDC_CLIENT_ID:?}"
|
|
AUTHENTIK_OIDC_CLIENT_SECRET: "${AUTHENTIK_OIDC_CLIENT_SECRET:?}"
|
|
volumes:
|
|
- authentik-data:/data
|
|
- ./dev/authentik/blueprints:/blueprints/custom
|
|
ports:
|
|
- "127.0.0.1:${AUTHENTIK_LISTEN_PORT:?}:9000"
|
|
# Recommended by upstream authentik to avoid a shared-memory-related crash in some subsystems.
|
|
shm_size: 512mb
|
|
|
|
authentik-worker:
|
|
image: ghcr.io/goauthentik/server:2026.8.0
|
|
command: worker
|
|
profiles:
|
|
- develop-idp
|
|
depends_on:
|
|
authentik-postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
AUTHENTIK_SECRET_KEY: "${AUTHENTIK_SECRET_KEY:?}"
|
|
AUTHENTIK_POSTGRESQL__HOST: authentik-postgres
|
|
AUTHENTIK_POSTGRESQL__NAME: authentik
|
|
AUTHENTIK_POSTGRESQL__USER: authentik
|
|
AUTHENTIK_POSTGRESQL__PASSWORD: "${AUTHENTIK_POSTGRES_PASSWORD:?}"
|
|
AUTHENTIK_BOOTSTRAP_EMAIL: "${AUTHENTIK_BOOTSTRAP_EMAIL:?}"
|
|
AUTHENTIK_BOOTSTRAP_PASSWORD: "${AUTHENTIK_BOOTSTRAP_PASSWORD:?}"
|
|
AUTHENTIK_BOOTSTRAP_TOKEN: "${AUTHENTIK_BOOTSTRAP_TOKEN:?}"
|
|
IDP_REDIRECT_PORT: "${EXPRESS_LISTEN_PORT:?}"
|
|
AUTHENTIK_OIDC_CLIENT_ID: "${AUTHENTIK_OIDC_CLIENT_ID:?}"
|
|
AUTHENTIK_OIDC_CLIENT_SECRET: "${AUTHENTIK_OIDC_CLIENT_SECRET:?}"
|
|
volumes:
|
|
- authentik-data:/data
|
|
- ./dev/authentik/blueprints:/blueprints/custom
|
|
shm_size: 512mb
|
|
|
|
volumes:
|
|
express-data:
|
|
postgres-data:
|
|
redis-data:
|
|
opensearch-data:
|
|
maildev-data:
|
|
sloleks:
|
|
authentik-postgres-data:
|
|
authentik-data:
|