I'm using docker and docker-compose for building my app. There are two developers now for the project hosted on github.
Our project structure is:
- sup
- dockerfiles
- dev
- build
- .profile
 - Dockerfile
 
 - docker-compose.yml
 
 - build
 
 - dev
 
 - dockerfiles
 
Now we have ./dockerfiles/dev/docker-compose.yml like this:
app:
    container_name: sup-dev
    build: ./build
and ./dockerfiles/dev/build/Dockerfile:
FROM sup:dev
# docker-compose tries to find .profile relative to build dir:
# ./dockerfiles/dev/build
COPY .profile /var/www/
We run container like so:
docker-compose up -d
Everything works fine, but due to different OS we have our code in different places: /home/aliance/www/project for me and /home/user/other/path/project for the second developer. So I can not just add volume instruction into Dockerfile.
Now we solve this problem in this wrong way:
- I am using lsyncd with my personal config to transfer files into the container
- While the second one uses volume instruction into Dockerfile but not commited it.
May be you know how can I write an unified Dockerfile for docker-compose to volume out code into app container from different paths?