2025-02-26 23:32:20 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
2025-02-27 19:19:42 +01:00
|
|
|
cd /opt/inventaire
|
|
|
|
|
|
2025-02-27 20:39:29 +01:00
|
|
|
# Overwrites the local config with environment variables every time the container is restarted
|
|
|
|
|
# This file can be itself overwritten either by ./config/local-production.cjs (assuming NODE_ENV=production) or by NODE_CONFIG
|
|
|
|
|
# See https://github.com/node-config/node-config/wiki/Configuration-Files#file-load-order
|
|
|
|
|
# and https://github.com/node-config/node-config/wiki/Environment-Variables#node_config
|
|
|
|
|
cat > "./config/local.cjs" << EOF
|
2025-02-26 23:32:20 +01:00
|
|
|
module.exports = {
|
2025-02-27 20:36:40 +01:00
|
|
|
hostname: 'inventaire',
|
2025-02-26 23:32:20 +01:00
|
|
|
port: '${INVENTAIRE_PORT}',
|
|
|
|
|
publicHostname: '${PUBLIC_HOSTNAME}',
|
|
|
|
|
instanceName: '${INSTANCE_NAME}',
|
|
|
|
|
orgName: '${ORG_NAME}',
|
|
|
|
|
orgUrl: '${ORG_URL}',
|
|
|
|
|
contactAddress: '${CONTACT_ADDRESS}',
|
|
|
|
|
|
|
|
|
|
db: {
|
|
|
|
|
username: '${COUCHDB_USER}',
|
|
|
|
|
password: '${COUCHDB_PASSWORD}',
|
|
|
|
|
hostname: 'couchdb',
|
|
|
|
|
},
|
|
|
|
|
elasticsearch: {
|
|
|
|
|
origin: 'http://elasticsearch:9200',
|
2025-02-27 17:59:22 +01:00
|
|
|
},
|
|
|
|
|
mailer: {
|
|
|
|
|
disabled: false,
|
|
|
|
|
nodemailer: {
|
|
|
|
|
host: '${MAILER_SMTP_HOST}',
|
|
|
|
|
port: ${MAILER_SMTP_PORT},
|
|
|
|
|
auth: {
|
|
|
|
|
user: '${MAILER_SMTP_USERNAME}',
|
|
|
|
|
pass: '${MAILER_SMTP_PASSWORD}'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2025-02-26 23:32:20 +01:00
|
|
|
}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
./scripts/typescript/start_built_server.sh
|