Merge branch 'master' of sso://user/ahmetb/microservices-demo

This commit is contained in:
Dan Sanche 2018-06-21 10:27:28 -07:00
commit 017c8a91ed
5 changed files with 8 additions and 5 deletions

BIN
.DS_Store vendored

Binary file not shown.

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.DS_Store
*.swp
*~

BIN
src/.DS_Store vendored

Binary file not shown.

View file

@ -8,9 +8,7 @@ ADD ./*.py /home/
WORKDIR /home
# set listen port
ENV PORT="8080"
#set product catalog address
ENV PRODUCT_CATALOG_SERVICE_ADDR="localhost:8081"
ENV PORT "8080"
EXPOSE 8080
ENTRYPOINT python /home/recommendation_server.py

View file

@ -30,7 +30,9 @@ if __name__ == "__main__":
# get port from $PORT envar
port = os.environ.get('PORT', "8080")
# get product catalog service address from $PRODUCT_CATALOG_SERVICE_ADDR envar
catalog_addr = os.environ.get('PRODUCT_CATALOG_SERVICE_ADDR', "localhost:8081")
catalog_addr = os.environ.get('PRODUCT_CATALOG_SERVICE_ADDR', '')
if catalog_addr == "":
raise Exception('PRODUCT_CATALOG_SERVICE_ADDR environment not set')
print("product catalog address: " + catalog_addr)
print("listening on port: " + port)