Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile and ENV #231

Open
fmax opened this issue Feb 10, 2021 · 1 comment
Open

Dockerfile and ENV #231

fmax opened this issue Feb 10, 2021 · 1 comment

Comments

@fmax
Copy link

fmax commented Feb 10, 2021

when building docker image and try to run with external mongo-db, than setting ENVs:
MONGO_SERVER=myserver
MONGO_PORT=9999
has no effect when 'start.sh' is running on container start and docker run will fail, because mongo connection localhost:27017 is not available.

in kuberenetes rancher cluster i mount the config.py as config volume, where i already put the correct mongo connection.
but this ended with error sed: cannot rename ./sedpeMyL1: Device or resource busy
so i fixed the related script start.sh:

if [ ! -f "./config.py" ]; then
  cp config.py-sample config.py
  sed -i 's/https = True/https = False/g' ./config.py
  sed -i "s/mongouri = \"mongodb:\/\/localhost:27017\/\"/mongouri = \"mongodb:\/\/${MONGO_SERVER-localhost}:${MONGO_PORT-27017}\"/g" ./config.py
fi

for my understanding it only makes sense to use sed for modifying config options in config.py, when the configfile does not exist - so sed is better placed within the if loop

@mikeaveli007
Copy link

mikeaveli007 commented Apr 7, 2022

I also found that the Dockerfile is cloning the 2.x branch into the image and that has a different config.py file with different settings so the sed command doesn't do anything because there is no mongouri setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants