francescou / docker-compose-ui

web interface for Docker Compose
http://francescou.github.io/docker-compose-ui
MIT License
1.54k stars 228 forks source link

Updates are not being reflected properly #49

Closed centralafricabaptistcollege closed 8 years ago

centralafricabaptistcollege commented 8 years ago

It seems that docker-compose-ui doesn't respond to changes to files on attached volumes well. If I make a change to the docker-compose.yml in the folder I mounted to /opt/docker-compose-projects it gives me an unexpected character #x0000 error. I have to move the file to docker-compose.yaml reload the page, then move it back or else I get a error:u message. I'm running docker 1.12.1 on my mac via docker-machine.

In addition (not sure if this is related) I changed the settings of a volume in the docker-compose.yml file and it seemed to add that to a cached list of the previous volumes settings, so that even though I had 2 volumes in my docker-compose file, it was showing 3 - the two current ones and the one that I changed that no longer exists. I've restarted the docker-compose-ui and it still seems to cache the settings. However, if I just manually run docker-compose up in the folder it works fine.

francescou commented 8 years ago

Hi, could you please provide me an example of docker-compose.yml file to reproduce the issue?

is this related to https://github.com/francescou/docker-compose-ui/issues/50 ?

centralafricabaptistcollege commented 8 years ago

In a way the it's related, but I'm not sure if it's completely related since the issue isn't that the volumes are being mounted wrong (like #50) its just that the wrong volume information isn't being updated, if that makes sense. As a result of #50 I decided to mount just the two volumes below. However they were both showing up as mounted. I'll try your fix to #50 and report back if it solves it. Thanks for the quick response.

  nginx:
    build: ./.docker/NGINX
    image: nginx.company.org 
    container_name: company.org
    restart: always
    environment:
        - VIRTUAL_HOST=company.org
        - DB_PORT_3306_TCP_ADDR=172.17.0.1
        - DB_ENV_MYSQL_USER=user
        - DB_ENV_MYSQL_DATABASE=database
        - DB_ENV_MYSQL_PASSWORD=password
    ports:
    - 80
    volumes:
        - ./code:/var/www/html/
        - data:/var/www/data:Z```
centralafricabaptistcollege commented 8 years ago

So I changed it to

`- ${PWD}/code:/var/www/html/

However, even though there is nothing in the compose file saying config.php if I push up on the docker-compose gui it only creates an empty config.php directory (!) under /var/www/html. Even though there are files in /code. If I do it via the terminal it works fine. I'm just trying to figure out where it's pulling the config.php directive from since I've deleted it from the docker-compose.yml

centralafricabaptistcollege commented 8 years ago

So I found something very odd. I wonder if it's an issue with the volume driver or something. I logged into the docker_compose_ui container and went to the directory containing my project repo. I opened the file in vim and it was displaying properly. However, when I ran cat on the file, it was showing a very old version of the file, which corresponded to the wrong settings I was seeing. I'm not familiar to seeing this issue with other docker images, but wonder if it might be unrelated to the docker_compose_ui. You ever seen it before?

centralafricabaptistcollege commented 8 years ago

So, for now what I did was actually just setup the python server from your docker file on my machine and run it that way. It bypasses all the path issues and file saving problems. It also has the benefit of being significantly faster. Conceptually I actually prefer this model as I'm hoping to use this to control my server running a number of different containers. If my docker controller is hosted on docker and docker is down I won't be able to utilize it and will lose most of the benefits of it. Obviously that's an individual choice, but I think for now I will go do this path and see how it goes.

Thanks so much for the awesome project. I had ideas of building an basic app to do essentially what this done. Glad to have been able to find this.

francescou commented 8 years ago

I don't think I ever had this kind of issue..you can try to execute a docker-compose down to remove previous container instances.

I'm not sure if this can help you...but I always put a slash character after the directory name, e.g.:

- ${PWD}/code/:/var/www/html/ - data/:/var/www/data/

thank you for your contribution