Files
docker-inventaire/inventaire/docker-entrypoint.sh
maxlath 10e33f919e inventaire: docker-entrypoint.sh: adapt the edited local config file to the used NODE_ENV
Everything is this docker-compose.yml is done with NODE_ENV=production in mind, but if someone wants to play with other environments,
that should now work too
2025-02-28 11:42:48 +01:00

27 lines
620 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
# Overwrite the local-${NODE_ENV} config with environment variables every time the container is restarted
cat > "./config/local-${NODE_ENV}.cjs" << EOF
module.exports = {
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',
}
}
EOF
./scripts/typescript/start_built_server.sh