example-voting-app icon indicating copy to clipboard operation
example-voting-app copied to clipboard

compose files unnecessarily mount host volumes

Open larryclaman opened this issue 6 years ago • 1 comments

** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **

  • If you have a bug working with Docker itself, not related to these labs, please file the bug on the Docker repo *
  • If you would like general support figuring out how to do something with Docker, please use the Docker Slack channel. If you're not on that channel, sign up for the Docker Community and you'll get an invite. *
  • Or go to the Docker Forums *

Please provide the following information so we can assess the issue you're having

Description

The docker-compose.yml (and docker-compose-simple.yml) file use volume mounts for the vote & result apps. While this is something a developer might do while conducting 'inner-loop' debugging, it seems unnecessary and poor practice to have as part of an example of "real code". It also assumes that the source code is on the same machine as the compose file, which really should not be a pre-req. Note that the containers build and execute perfectly fine without the volume mounts

Steps to reproduce the issue, if relevant: see this code:

services: vote: build: ./vote command: python app.py volumes: - ./vote:/app ports: - "5000:80" networks: - front-tier - back-tier

result: build: ./result command: nodemon server.js volumes: - ./result:/app ports: - "5001:80" - "5858:5858" networks: - front-tier - back-tier

larryclaman avatar Oct 07 '19 19:10 larryclaman

Created PR #149 with proposed fix

larryclaman avatar Oct 07 '19 19:10 larryclaman

We've added a docker-compose.images.yml to do just that... demo the app w/o needing source code downloaded or manual building of images.

BretFisher avatar Dec 17 '22 03:12 BretFisher