I have a project folder containing my docker compose file. This references a child folder as a sub project.
When running docker compose an ADD adds the docker-compose location and not the sub directory as expected.
project/docker-compose.yml
db:
image: postgres
api:
build: ./api
command: bundle exec rails s --port 3000 --binding 0.0.0.0
ports:
- "3000:3000"
links:
- db
volumes:
- .:/myapp
Here is the api dockerfile.
FROM ruby:2.2.3
RUN apt-get update -qq && apt-get install -y build-essential
ENV APP_HOME /myapp
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
ADD Gemfile* $APP_HOME/
RUN bundle install
ADD . $APP_HOME # Expect this to add project/api to /myapp but adds project