danionescu0 / docker-flask-mongodb-example

Uses docker compose with a python flask microservice and MongoDB instance to make a sample application
GNU General Public License v3.0
99 stars 41 forks source link

getting error running `docker-compose build` #49

Closed neelabalan closed 3 years ago

neelabalan commented 3 years ago

I followed the instructions to start the micorservice and got the following error

~ docker-compose --version
docker-compose version 1.28.4, build cabd5cfb

~ docker --version
Docker version 20.10.2, build 2291f61

~ docker-compose build
WARNING: Some services (krakend) use the 'configs' key, which will be ignored. Compose does not support 'configs' configuration - use `docker stack deploy` to deploy to a swarm.
ERROR: Invalid restart policy "always"

I did some search in the internet for similar issues and found this and made some changes to docker-compose.yml but I am not sure if this right way to do this.

     krakend:
         image: devopsfaith/krakend
         volumes:
-            - ./:/etc/krakend/
-        configs:
-          - krakend_config
+            - ./kraken.json:/etc/krakend
         ports:
             - "8080:8080"

Also I have the changed deploy.restart_policy to on-failiure since always option is not available. After making these changes I am able to locally start all the services.

Let me know if there is any further iteration on the above solution to raise a PR.

danionescu0 commented 3 years ago

I've removed the restart policy yesterday because it was only in swarm. I've also removed the config section for krakend. Your solution with mounting just the kraken.json is better so please raise a PR with that line and i'll test and approve it.

Thanks

neelabalan commented 3 years ago

Hi. I have raised a PR for the suggested change. Thanks.