diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d8e54..7f188cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Bugfix] Fix MongoDb url in forum when running separate service (#267) - 💥[Improvement] Better `dev` commands, with dedicated development docker image. One of the consequences is that the `dev watchthemes` command is replaced by `dev run lms watchthemes`. - [Improvement] `images` commands now accept multiple `image` arguments diff --git a/tutor/templates/build/forum/Dockerfile b/tutor/templates/build/forum/Dockerfile index eb81aaf..c0dba26 100644 --- a/tutor/templates/build/forum/Dockerfile +++ b/tutor/templates/build/forum/Dockerfile @@ -46,6 +46,5 @@ ENV SEARCH_SERVER "http://elasticsearch:9200" ENV MONGODB_AUTH "" ENV MONGODB_HOST "mongodb" ENV MONGODB_PORT "27017" -ENV MONGOHQ_URL "mongodb://$MONGODB_AUTH$MONGODB_HOST:$MONGODB_PORT/cs_comments_service" EXPOSE 4567 CMD ./bin/unicorn -c config/unicorn_tcp.rb -I '.' diff --git a/tutor/templates/build/forum/bin/docker-entrypoint.sh b/tutor/templates/build/forum/bin/docker-entrypoint.sh index de18574..13fbdf2 100755 --- a/tutor/templates/build/forum/bin/docker-entrypoint.sh +++ b/tutor/templates/build/forum/bin/docker-entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/sh -e +export MONGOHQ_URL="mongodb://$MONGODB_AUTH$MONGODB_HOST:$MONGODB_PORT/cs_comments_service" + echo "Waiting for mongodb/elasticsearch..." dockerize -wait tcp://$MONGODB_HOST:$MONGODB_PORT -wait $SEARCH_SERVER/content -wait-retry-interval 5s -timeout 600s diff --git a/tutor/templates/hooks/forum/init b/tutor/templates/hooks/forum/init index 2e9cf9f..9a1532e 100644 --- a/tutor/templates/hooks/forum/init +++ b/tutor/templates/hooks/forum/init @@ -1,2 +1,4 @@ +export MONGOHQ_URL="mongodb://$MONGODB_AUTH$MONGODB_HOST:$MONGODB_PORT/cs_comments_service" + bundle exec rake search:initialize bundle exec rake search:rebuild_index