This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
idhub-docker/docker/orchestra.entrypoint.sh
pedro 27742db4fb init with previous work
this repo is a reinitialization with a change in the concept

previous repo had git subtree of django-musician and django-orchestra,
that was too static for our interest

next approach is a script that pulls git repos, and that would be
needed if you want to build everything, if not, just with the docker
compose you would have enough for running the containers, hence,
downloading the images from the docker registry
2023-10-10 10:07:46 +02:00

31 lines
746 B
Bash
Executable file

#!/bin/sh
set -e
set -u
#set -x
_subs() {
key="${1}"
value="${2}"
file="${3}"
sed -i "s/^\(${key} =\).*/\1 '${value}'/" "${file}"
}
# go to the same path as the script
cd "$(dirname ${0})"
SECRET_KEY=${SECRET_KEY}
ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
# override settings with env vars defined in docker
settings_file='panel/settings.py'
_subs 'ALLOWED_HOSTS' "${ALLOWED_HOSTS}" "${settings_file}"
_subs 'SECRET_KEY' "${SECRET_KEY}" "${settings_file}"
# move the migrate thing in docker entrypoint
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
#python3 manage.py migrate
expect -f ./orchestra.migrate.exp
./manage.py runserver 0.0.0.0:9080