0

I have 2 services in docker-compose one downloads data, and creates a file and attaches it to a volume, which makes it accessible to other container. That works fine.

The issue am having is, I want to append the file datadump.json in the /home-dir/ without overwriting any data in there. Just add the file to the existing folder which has other files.

  scheduler:
    build: 
      context: .
      dockerfile: scheduler.Dockerfile
    environment:
      - HEROKU_API_KEY=*****
    command: bash -c "heroku run python manage.py dumpdata > datadump.json --app my-app && mv datadump.json data-dump && ls cb-data-dump"
    volumes:
      - data-dump:/data-dump
  app:
    restart: always
    build: .
    ports:
      - 8000:8000
    volumes:
      - data-dump:/data-dump/
      - ./:/home-dir/
Shammir
  • 927
  • 4
  • 17
  • 32
  • Does this answer your question? [How to mount a single file in a volume](https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume) – Rob Evans Feb 06 '23 at 20:00

0 Answers0