how to pass domain name to the container in Container Instances, OCI?

73 Views Asked by At

I am running Django application image in container that requires "CSRF_TRUSTED_ORIGINS" to be passed as env variable, but it looks like container instances generate the domain after the deployment; or how can I set the env variable of container DJANGO_CSRF_TRUSTED_ORIGINS="container instance domain" before running the container.

1

There are 1 best solutions below

0
On

you can simply run a bash script that fetches the ip of your required container and update the env file . I faced the similar issue and this is link. Make sure to change the env variables in the update_env.sh accordingly . In your docker-compose.yml file set depends_on: variable of django container to dependent container (this will ensure your dependent container runs first and ip is known).